Can delete the Offline Messages sent to/from a user.
This is useful if the user is deleted.master-beforevarregion
parent
46c2791fe2
commit
2d9d6fe922
|
@ -261,6 +261,11 @@ namespace OpenSim.OfflineIM
|
||||||
return m_OfflineIMService.StoreMessage(im, out reason);
|
return m_OfflineIMService.StoreMessage(im, out reason);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void DeleteMessages(UUID userID)
|
||||||
|
{
|
||||||
|
m_OfflineIMService.DeleteMessages(userID);
|
||||||
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -117,6 +117,14 @@ namespace OpenSim.OfflineIM
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void DeleteMessages(UUID userID)
|
||||||
|
{
|
||||||
|
Dictionary<string, object> sendData = new Dictionary<string, object>();
|
||||||
|
sendData["UserID"] = userID;
|
||||||
|
|
||||||
|
MakeRequest("DELETE", sendData);
|
||||||
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -102,6 +102,8 @@ namespace OpenSim.OfflineIM
|
||||||
return HandleGet(request);
|
return HandleGet(request);
|
||||||
case "STORE":
|
case "STORE":
|
||||||
return HandleStore(request);
|
return HandleStore(request);
|
||||||
|
case "DELETE":
|
||||||
|
return HandleDelete(request);
|
||||||
}
|
}
|
||||||
m_log.DebugFormat("[OFFLINE IM HANDLER]: unknown method request: {0}", method);
|
m_log.DebugFormat("[OFFLINE IM HANDLER]: unknown method request: {0}", method);
|
||||||
}
|
}
|
||||||
|
@ -158,6 +160,21 @@ namespace OpenSim.OfflineIM
|
||||||
return Util.UTF8NoBomEncoding.GetBytes(xmlString);
|
return Util.UTF8NoBomEncoding.GetBytes(xmlString);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
byte[] HandleDelete(Dictionary<string, object> request)
|
||||||
|
{
|
||||||
|
if (!request.ContainsKey("UserID"))
|
||||||
|
{
|
||||||
|
return FailureResult();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
UUID userID = new UUID(request["UserID"].ToString());
|
||||||
|
m_OfflineIMService.DeleteMessages(userID);
|
||||||
|
|
||||||
|
return SuccessResult();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#region Helpers
|
#region Helpers
|
||||||
|
|
||||||
private void NullResult(Dictionary<string, object> result, string reason)
|
private void NullResult(Dictionary<string, object> result, string reason)
|
||||||
|
|
|
@ -124,5 +124,12 @@ namespace OpenSim.OfflineIM
|
||||||
return m_Database.Store(data);
|
return m_Database.Store(data);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void DeleteMessages(UUID userID)
|
||||||
|
{
|
||||||
|
m_Database.Delete("PrincipalID", userID.ToString());
|
||||||
|
m_Database.Delete("FromID", userID.ToString());
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,7 +35,14 @@ namespace OpenSim.Services.Interfaces
|
||||||
public interface IOfflineIMService
|
public interface IOfflineIMService
|
||||||
{
|
{
|
||||||
List<GridInstantMessage> GetMessages(UUID principalID);
|
List<GridInstantMessage> GetMessages(UUID principalID);
|
||||||
|
|
||||||
bool StoreMessage(GridInstantMessage im, out string reason);
|
bool StoreMessage(GridInstantMessage im, out string reason);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Delete messages to or from this user (or group).
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="userID">A user or group ID</param>
|
||||||
|
void DeleteMessages(UUID userID);
|
||||||
}
|
}
|
||||||
|
|
||||||
public class OfflineIMDataUtils
|
public class OfflineIMDataUtils
|
||||||
|
|
Loading…
Reference in New Issue