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
0.6.5-rc1
Melanie Thielker 2009-04-12 12:44:41 +00:00
parent 2864c45678
commit 9d31cfafb2
1 changed files with 10 additions and 14 deletions

View File

@ -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);
}
}