Fix the offline message module to revert core changes and restore avn

specific behavior
avinationmerge
Melanie 2011-10-28 23:10:54 +02:00
parent 9b6ce41b0e
commit 175d74e68c
1 changed files with 27 additions and 17 deletions

View File

@ -208,26 +208,36 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
private void UndeliveredMessage(GridInstantMessage im) private void UndeliveredMessage(GridInstantMessage im)
{ {
if ((im.offline != 0) if (im.dialog != (byte)InstantMessageDialog.MessageFromObject &&
&& (!im.fromGroup || (im.fromGroup && m_ForwardOfflineGroupMessages))) im.dialog != (byte)InstantMessageDialog.MessageFromAgent &&
im.dialog != (byte)InstantMessageDialog.GroupNotice &&
im.dialog != (byte)InstantMessageDialog.GroupInvitation &&
im.dialog != (byte)InstantMessageDialog.InventoryOffered)
{ {
bool success = SynchronousRestObjectRequester.MakeRequest<GridInstantMessage, bool>( return;
"POST", m_RestURL + "/SaveMessage/", im); }
if (im.dialog == (byte)InstantMessageDialog.MessageFromAgent) Scene scene = FindScene(new UUID(im.fromAgentID));
{ if (scene == null)
IClientAPI client = FindClient(new UUID(im.fromAgentID)); scene = m_SceneList[0];
if (client == null)
return;
client.SendInstantMessage(new GridInstantMessage( bool success = SynchronousRestObjectRequester.MakeRequest<GridInstantMessage, bool>(
null, new UUID(im.toAgentID), "POST", m_RestURL+"/SaveMessage/?scope=" +
"System", new UUID(im.fromAgentID), scene.RegionInfo.ScopeID.ToString(), im);
(byte)InstantMessageDialog.MessageFromAgent,
"User is not logged in. " + if (im.dialog == (byte)InstantMessageDialog.MessageFromAgent)
(success ? "Message saved." : "Message not saved"), {
false, new Vector3())); IClientAPI client = FindClient(new UUID(im.fromAgentID));
} if (client == null)
return;
client.SendInstantMessage(new GridInstantMessage(
null, new UUID(im.toAgentID),
"System", new UUID(im.fromAgentID),
(byte)InstantMessageDialog.MessageFromAgent,
"User is not logged in. "+
(success ? "Message saved." : "Message not saved"),
false, new Vector3()));
} }
} }
} }