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);
|
||||
}
|
||||
|
||||
public void DeleteMessages(UUID userID)
|
||||
{
|
||||
m_OfflineIMService.DeleteMessages(userID);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
|
|
@ -117,6 +117,14 @@ namespace OpenSim.OfflineIM
|
|||
return true;
|
||||
}
|
||||
|
||||
public void DeleteMessages(UUID userID)
|
||||
{
|
||||
Dictionary<string, object> sendData = new Dictionary<string, object>();
|
||||
sendData["UserID"] = userID;
|
||||
|
||||
MakeRequest("DELETE", sendData);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
|
|
@ -102,6 +102,8 @@ namespace OpenSim.OfflineIM
|
|||
return HandleGet(request);
|
||||
case "STORE":
|
||||
return HandleStore(request);
|
||||
case "DELETE":
|
||||
return HandleDelete(request);
|
||||
}
|
||||
m_log.DebugFormat("[OFFLINE IM HANDLER]: unknown method request: {0}", method);
|
||||
}
|
||||
|
@ -158,6 +160,21 @@ namespace OpenSim.OfflineIM
|
|||
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
|
||||
|
||||
private void NullResult(Dictionary<string, object> result, string reason)
|
||||
|
|
|
@ -124,5 +124,12 @@ namespace OpenSim.OfflineIM
|
|||
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
|
||||
{
|
||||
List<GridInstantMessage> GetMessages(UUID principalID);
|
||||
|
||||
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
|
||||
|
|
Loading…
Reference in New Issue