From 9d31cfafb2a120c7f5675aef1b093f3077392734 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Sun, 12 Apr 2009 12:44:41 +0000 Subject: Funnel stored (offline) IMs through the Scene EventManager to make sure they are processed by the modules rather than sent to the client directly. Allows friends and group requests and responses to be saved, too --- .../Avatar/InstantMessage/OfflineMessageModule.cs | 24 +++++++++------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/OpenSim/Region/CoreModules/Avatar/InstantMessage/OfflineMessageModule.cs b/OpenSim/Region/CoreModules/Avatar/InstantMessage/OfflineMessageModule.cs index a521ead..09a75e2 100644 --- a/OpenSim/Region/CoreModules/Avatar/InstantMessage/OfflineMessageModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/InstantMessage/OfflineMessageModule.cs @@ -148,19 +148,6 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage //client.OnEconomyDataRequest += OnEconomyDataRequest; } - // TODO: Remove method when mute lists are supported - // - //private void OnEconomyDataRequest(UUID agentID) - //{ - // IClientAPI client = FindClient(agentID); - // if (client == null) - // { - // m_log.ErrorFormat("[OFFLINE MESSAGING] Can't find client {0}", agentID.ToString()); - // return; - // } - // RetrieveInstantMessages(client); - //} - private void RetrieveInstantMessages(IClientAPI client) { m_log.DebugFormat("[OFFLINE MESSAGING] Retrieving stored messages for {0}", client.AgentId); @@ -173,7 +160,16 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage DateTime saved = Util.ToDateTime((uint)im.timestamp); im.message = "(saved " + saved.ToString() + ") " + im.message; - client.SendInstantMessage(im); + + // client.SendInstantMessage(im); + + // Send through scene event manager so all modules get a chance + // to look at this message before it gets delivered. + // + // Needed for proper state management for stored group + // invitations + // + client.Scene.EventManager.TriggerIncomingInstantMessage(im); } } -- cgit v1.1