aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorDiva Canto2013-07-27 20:30:00 -0700
committerDiva Canto2013-07-27 20:30:00 -0700
commit8dff05a89798543994cb6e5ac5e5f715daf5898b (patch)
tree4aed82b99c83238e658dc69761575a049b84ea98
parentClarification on docs of .ini.examples for Groups (again) (diff)
downloadopensim-SC_OLD-8dff05a89798543994cb6e5ac5e5f715daf5898b.zip
opensim-SC_OLD-8dff05a89798543994cb6e5ac5e5f715daf5898b.tar.gz
opensim-SC_OLD-8dff05a89798543994cb6e5ac5e5f715daf5898b.tar.bz2
opensim-SC_OLD-8dff05a89798543994cb6e5ac5e5f715daf5898b.tar.xz
More on group chat: only root agents should subscribe to OnInstantMessage, or else they'll see an echo of their own messages after teleporting.
-rw-r--r--OpenSim/Addons/Groups/GroupsMessagingModule.cs15
1 files changed, 14 insertions, 1 deletions
diff --git a/OpenSim/Addons/Groups/GroupsMessagingModule.cs b/OpenSim/Addons/Groups/GroupsMessagingModule.cs
index 04e2b80..ce4f597 100644
--- a/OpenSim/Addons/Groups/GroupsMessagingModule.cs
+++ b/OpenSim/Addons/Groups/GroupsMessagingModule.cs
@@ -129,9 +129,12 @@ namespace OpenSim.Groups
129 m_sceneList.Add(scene); 129 m_sceneList.Add(scene);
130 130
131 scene.EventManager.OnNewClient += OnNewClient; 131 scene.EventManager.OnNewClient += OnNewClient;
132 scene.EventManager.OnMakeRootAgent += OnMakeRootAgent;
133 scene.EventManager.OnMakeChildAgent += OnMakeChildAgent;
132 scene.EventManager.OnIncomingInstantMessage += OnGridInstantMessage; 134 scene.EventManager.OnIncomingInstantMessage += OnGridInstantMessage;
133 scene.EventManager.OnClientLogin += OnClientLogin; 135 scene.EventManager.OnClientLogin += OnClientLogin;
134 } 136 }
137
135 public void RegionLoaded(Scene scene) 138 public void RegionLoaded(Scene scene)
136 { 139 {
137 if (!m_groupMessagingEnabled) 140 if (!m_groupMessagingEnabled)
@@ -347,10 +350,20 @@ namespace OpenSim.Groups
347 { 350 {
348 if (m_debugEnabled) m_log.DebugFormat("[Groups.Messaging]: OnInstantMessage registered for {0}", client.Name); 351 if (m_debugEnabled) m_log.DebugFormat("[Groups.Messaging]: OnInstantMessage registered for {0}", client.Name);
349 352
350 client.OnInstantMessage += OnInstantMessage;
351 ResetAgentGroupChatSessions(client.AgentId.ToString()); 353 ResetAgentGroupChatSessions(client.AgentId.ToString());
352 } 354 }
353 355
356 void OnMakeRootAgent(ScenePresence sp)
357 {
358 sp.ControllingClient.OnInstantMessage += OnInstantMessage;
359 }
360
361 void OnMakeChildAgent(ScenePresence sp)
362 {
363 sp.ControllingClient.OnInstantMessage -= OnInstantMessage;
364 }
365
366
354 private void OnGridInstantMessage(GridInstantMessage msg) 367 private void OnGridInstantMessage(GridInstantMessage msg)
355 { 368 {
356 // The instant message module will only deliver messages of dialog types: 369 // The instant message module will only deliver messages of dialog types: