diff options
-rw-r--r-- | OpenSim/Region/CoreModules/Avatar/InstantMessage/OfflineMessageModule.cs | 46 |
1 files changed, 28 insertions, 18 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/InstantMessage/OfflineMessageModule.cs b/OpenSim/Region/CoreModules/Avatar/InstantMessage/OfflineMessageModule.cs index 3373bd5..5ab604f 100644 --- a/OpenSim/Region/CoreModules/Avatar/InstantMessage/OfflineMessageModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/InstantMessage/OfflineMessageModule.cs | |||
@@ -208,26 +208,36 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage | |||
208 | 208 | ||
209 | private void UndeliveredMessage(GridInstantMessage im) | 209 | private void UndeliveredMessage(GridInstantMessage im) |
210 | { | 210 | { |
211 | if ((im.offline != 0) | 211 | if (im.dialog != (byte)InstantMessageDialog.MessageFromObject && |
212 | && (!im.fromGroup || (im.fromGroup && m_ForwardOfflineGroupMessages))) | 212 | im.dialog != (byte)InstantMessageDialog.MessageFromAgent && |
213 | im.dialog != (byte)InstantMessageDialog.GroupNotice && | ||
214 | im.dialog != (byte)InstantMessageDialog.GroupInvitation && | ||
215 | im.dialog != (byte)InstantMessageDialog.InventoryOffered) | ||
213 | { | 216 | { |
214 | bool success = SynchronousRestObjectRequester.MakeRequest<GridInstantMessage, bool>( | 217 | return; |
215 | "POST", m_RestURL + "/SaveMessage/", im); | 218 | } |
216 | 219 | ||
217 | if (im.dialog == (byte)InstantMessageDialog.MessageFromAgent) | 220 | Scene scene = FindScene(new UUID(im.fromAgentID)); |
218 | { | 221 | if (scene == null) |
219 | IClientAPI client = FindClient(new UUID(im.fromAgentID)); | 222 | scene = m_SceneList[0]; |
220 | if (client == null) | 223 | |
221 | return; | 224 | bool success = SynchronousRestObjectRequester.MakeRequest<GridInstantMessage, bool>( |
222 | 225 | "POST", m_RestURL+"/SaveMessage/?scope=" + | |
223 | client.SendInstantMessage(new GridInstantMessage( | 226 | scene.RegionInfo.ScopeID.ToString(), im); |
224 | null, new UUID(im.toAgentID), | 227 | |
225 | "System", new UUID(im.fromAgentID), | 228 | if (im.dialog == (byte)InstantMessageDialog.MessageFromAgent) |
226 | (byte)InstantMessageDialog.MessageFromAgent, | 229 | { |
227 | "User is not logged in. " + | 230 | IClientAPI client = FindClient(new UUID(im.fromAgentID)); |
228 | (success ? "Message saved." : "Message not saved"), | 231 | if (client == null) |
229 | false, new Vector3())); | 232 | return; |
230 | } | 233 | |
234 | client.SendInstantMessage(new GridInstantMessage( | ||
235 | null, new UUID(im.toAgentID), | ||
236 | "System", new UUID(im.fromAgentID), | ||
237 | (byte)InstantMessageDialog.MessageFromAgent, | ||
238 | "User is not logged in. "+ | ||
239 | (success ? "Message saved." : "Message not saved"), | ||
240 | false, new Vector3())); | ||
231 | } | 241 | } |
232 | } | 242 | } |
233 | } | 243 | } |