From 388c053dcb8de3d9b89c99989af1990296cf2001 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Sat, 1 Nov 2008 18:18:19 +0000 Subject: Make the IM and friends modules optional. Clean up some code that dealt with the old Grid Instant Message over OGS1. Refactor the EventManager to be independent of the rigid module structure design imposed by the current implementation. Message routing is now done in the destination module rather than in the event manager. This way, more or less granular solutions are possible without core changes. --- OpenSim/Region/Environment/Modules/Avatar/Friends/FriendsModule.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/Environment/Modules/Avatar/Friends/FriendsModule.cs') diff --git a/OpenSim/Region/Environment/Modules/Avatar/Friends/FriendsModule.cs b/OpenSim/Region/Environment/Modules/Avatar/Friends/FriendsModule.cs index c51bcc1..a380700 100644 --- a/OpenSim/Region/Environment/Modules/Avatar/Friends/FriendsModule.cs +++ b/OpenSim/Region/Environment/Modules/Avatar/Friends/FriendsModule.cs @@ -67,7 +67,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Friends m_scene.Add(scene); } scene.EventManager.OnNewClient += OnNewClient; - scene.EventManager.OnGridInstantMessageToFriendsModule += OnGridInstantMessage; + scene.EventManager.OnGridInstantMessage += OnGridInstantMessage; scene.EventManager.OnAvatarEnteringNewParcel += AvatarEnteringParcel; scene.EventManager.OnMakeChildAgent += MakeChildAgent; scene.EventManager.OnClientClosed += ClientLoggedOut; @@ -620,8 +620,11 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Friends // TODO: Inform the client that the ExFriend is offline } - private void OnGridInstantMessage(GridInstantMessage msg) + private void OnGridInstantMessage(GridInstantMessage msg, InstantMessageReceiver whichModule) { + if ((whichModule & InstantMessageReceiver.FriendsModule) == 0) + return; + // Trigger the above event handler OnInstantMessage(null, new UUID(msg.fromAgentID), new UUID(msg.fromAgentSession), new UUID(msg.toAgentID), new UUID(msg.imSessionID), msg.timestamp, msg.fromAgentName, -- cgit v1.1