aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Modules
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Environment/Modules/Avatar/InstantMessage/InstantMessageModule.cs17
1 files changed, 11 insertions, 6 deletions
diff --git a/OpenSim/Region/Environment/Modules/Avatar/InstantMessage/InstantMessageModule.cs b/OpenSim/Region/Environment/Modules/Avatar/InstantMessage/InstantMessageModule.cs
index b8fbe2b..a673f7b 100644
--- a/OpenSim/Region/Environment/Modules/Avatar/InstantMessage/InstantMessageModule.cs
+++ b/OpenSim/Region/Environment/Modules/Avatar/InstantMessage/InstantMessageModule.cs
@@ -35,6 +35,7 @@ using log4net;
35using Nini.Config; 35using Nini.Config;
36using Nwc.XmlRpc; 36using Nwc.XmlRpc;
37using OpenSim.Framework; 37using OpenSim.Framework;
38using OpenSim.Framework.Client;
38using OpenSim.Region.Environment.Interfaces; 39using OpenSim.Region.Environment.Interfaces;
39using OpenSim.Region.Environment.Scenes; 40using OpenSim.Region.Environment.Scenes;
40 41
@@ -74,12 +75,21 @@ namespace OpenSim.Region.Environment.Modules.Avatar.InstantMessage
74 if (!m_scenes.Contains(scene)) 75 if (!m_scenes.Contains(scene))
75 { 76 {
76 m_scenes.Add(scene); 77 m_scenes.Add(scene);
77 scene.EventManager.OnNewClient += OnNewClient; 78 scene.EventManager.OnClientConnect += OnClientConnect;
78 scene.EventManager.OnGridInstantMessage += OnGridInstantMessage; 79 scene.EventManager.OnGridInstantMessage += OnGridInstantMessage;
79 } 80 }
80 } 81 }
81 } 82 }
82 83
84 void OnClientConnect(IClientCore client)
85 {
86 IClientIM clientIM;
87 if(client.TryGet(out clientIM))
88 {
89 clientIM.OnInstantMessage += OnInstantMessage;
90 }
91 }
92
83 private void ReadConfig(IConfigSource config) 93 private void ReadConfig(IConfigSource config)
84 { 94 {
85 IConfig cnf = config.Configs["Startup"]; 95 IConfig cnf = config.Configs["Startup"];
@@ -109,11 +119,6 @@ namespace OpenSim.Region.Environment.Modules.Avatar.InstantMessage
109 119
110 #endregion 120 #endregion
111 121
112 private void OnNewClient(IClientAPI client)
113 {
114 client.OnInstantMessage += OnInstantMessage;
115 }
116
117 private void OnInstantMessage(IClientAPI client, UUID fromAgentID, 122 private void OnInstantMessage(IClientAPI client, UUID fromAgentID,
118 UUID fromAgentSession, UUID toAgentID, 123 UUID fromAgentSession, UUID toAgentID,
119 UUID imSessionID, uint timestamp, string fromAgentName, 124 UUID imSessionID, uint timestamp, string fromAgentName,