aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules/Avatar/InstantMessage
diff options
context:
space:
mode:
authorMelanie2011-10-27 18:14:38 +0100
committerMelanie2011-10-27 18:14:38 +0100
commitb975cbcbed71b12898052395fbc83a5880273190 (patch)
treef149288740af5227a865783a51f566bef537721e /OpenSim/Region/CoreModules/Avatar/InstantMessage
parentMerge branch 'master' into bigmerge (diff)
parentRemoved use of 'is' operator and casting to find the root ScenePresence in Me... (diff)
downloadopensim-SC_OLD-b975cbcbed71b12898052395fbc83a5880273190.zip
opensim-SC_OLD-b975cbcbed71b12898052395fbc83a5880273190.tar.gz
opensim-SC_OLD-b975cbcbed71b12898052395fbc83a5880273190.tar.bz2
opensim-SC_OLD-b975cbcbed71b12898052395fbc83a5880273190.tar.xz
Merge branch 'master' into bigmerge
Conflicts: OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
Diffstat (limited to 'OpenSim/Region/CoreModules/Avatar/InstantMessage')
-rw-r--r--OpenSim/Region/CoreModules/Avatar/InstantMessage/HGMessageTransferModule.cs57
-rw-r--r--OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs26
2 files changed, 33 insertions, 50 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/InstantMessage/HGMessageTransferModule.cs b/OpenSim/Region/CoreModules/Avatar/InstantMessage/HGMessageTransferModule.cs
index 72b448b..321a705 100644
--- a/OpenSim/Region/CoreModules/Avatar/InstantMessage/HGMessageTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/InstantMessage/HGMessageTransferModule.cs
@@ -143,24 +143,19 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
143 // Try root avatar only first 143 // Try root avatar only first
144 foreach (Scene scene in m_Scenes) 144 foreach (Scene scene in m_Scenes)
145 { 145 {
146 if (scene.Entities.ContainsKey(toAgentID) && 146// m_log.DebugFormat(
147 scene.Entities[toAgentID] is ScenePresence) 147// "[HG INSTANT MESSAGE]: Looking for root agent {0} in {1}",
148 { 148// toAgentID.ToString(), scene.RegionInfo.RegionName);
149// m_log.DebugFormat( 149 ScenePresence sp = scene.GetScenePresence(toAgentID);
150// "[HG INSTANT MESSAGE]: Looking for root agent {0} in {1}", 150 if (sp != null && !sp.IsChildAgent)
151// toAgentID.ToString(), scene.RegionInfo.RegionName); 151 {
152 152 // Local message
153 ScenePresence user = (ScenePresence) scene.Entities[toAgentID]; 153// m_log.DebugFormat("[HG INSTANT MESSAGE]: Delivering IM to root agent {0} {1}", user.Name, toAgentID);
154 if (!user.IsChildAgent) 154 sp.ControllingClient.SendInstantMessage(im);
155 {
156 // Local message
157// m_log.DebugFormat("[HG INSTANT MESSAGE]: Delivering IM to root agent {0} {1}", user.Name, toAgentID);
158 user.ControllingClient.SendInstantMessage(im);
159 155
160 // Message sent 156 // Message sent
161 result(true); 157 result(true);
162 return; 158 return;
163 }
164 } 159 }
165 } 160 }
166 161
@@ -168,16 +163,14 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
168 foreach (Scene scene in m_Scenes) 163 foreach (Scene scene in m_Scenes)
169 { 164 {
170// m_log.DebugFormat( 165// m_log.DebugFormat(
171// "[HG INSTANT MESSAGE]: Looking for child of {0} in {1}", toAgentID, scene.RegionInfo.RegionName); 166// "[HG INSTANT MESSAGE]: Looking for child of {0} in {1}",
172 167// toAgentID, scene.RegionInfo.RegionName);
173 if (scene.Entities.ContainsKey(toAgentID) && 168 ScenePresence sp = scene.GetScenePresence(toAgentID);
174 scene.Entities[toAgentID] is ScenePresence) 169 if (sp != null)
175 { 170 {
176 // Local message 171 // Local message
177 ScenePresence user = (ScenePresence) scene.Entities[toAgentID];
178
179// m_log.DebugFormat("[HG INSTANT MESSAGE]: Delivering IM to child agent {0} {1}", user.Name, toAgentID); 172// m_log.DebugFormat("[HG INSTANT MESSAGE]: Delivering IM to child agent {0} {1}", user.Name, toAgentID);
180 user.ControllingClient.SendInstantMessage(im); 173 sp.ControllingClient.SendInstantMessage(im);
181 174
182 // Message sent 175 // Message sent
183 result(true); 176 result(true);
@@ -231,17 +224,11 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
231 bool successful = false; 224 bool successful = false;
232 foreach (Scene scene in m_Scenes) 225 foreach (Scene scene in m_Scenes)
233 { 226 {
234 if (scene.Entities.ContainsKey(toAgentID) && 227 ScenePresence sp = scene.GetScenePresence(toAgentID);
235 scene.Entities[toAgentID] is ScenePresence) 228 if(!sp.IsChildAgent)
236 { 229 {
237 ScenePresence user = 230 scene.EventManager.TriggerIncomingInstantMessage(gim);
238 (ScenePresence)scene.Entities[toAgentID]; 231 successful = true;
239
240 if (!user.IsChildAgent)
241 {
242 scene.EventManager.TriggerIncomingInstantMessage(gim);
243 successful = true;
244 }
245 } 232 }
246 } 233 }
247 if (!successful) 234 if (!successful)
diff --git a/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs b/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs
index ff74354..712632b 100644
--- a/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs
@@ -140,8 +140,11 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
140 // Try root avatar only first 140 // Try root avatar only first
141 foreach (Scene scene in m_Scenes) 141 foreach (Scene scene in m_Scenes)
142 { 142 {
143 if (scene.Entities.ContainsKey(toAgentID) && 143// m_log.DebugFormat(
144 scene.Entities[toAgentID] is ScenePresence) 144// "[INSTANT MESSAGE]: Looking for root agent {0} in {1}",
145// toAgentID.ToString(), scene.RegionInfo.RegionName);
146 ScenePresence sp = scene.GetScenePresence(toAgentID);
147 if (sp != null && !sp.IsChildAgent)
145 { 148 {
146// m_log.DebugFormat( 149// m_log.DebugFormat(
147// "[INSTANT MESSAGE]: Looking for root agent {0} in {1}", 150// "[INSTANT MESSAGE]: Looking for root agent {0} in {1}",
@@ -165,9 +168,8 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
165 { 168 {
166// m_log.DebugFormat( 169// m_log.DebugFormat(
167// "[INSTANT MESSAGE]: Looking for child of {0} in {1}", toAgentID, scene.RegionInfo.RegionName); 170// "[INSTANT MESSAGE]: Looking for child of {0} in {1}", toAgentID, scene.RegionInfo.RegionName);
168 171 ScenePresence sp = scene.GetScenePresence(toAgentID);
169 if (scene.Entities.ContainsKey(toAgentID) && 172 if (sp != null)
170 scene.Entities[toAgentID] is ScenePresence)
171 { 173 {
172 // Local message 174 // Local message
173 ScenePresence user = (ScenePresence) scene.Entities[toAgentID]; 175 ScenePresence user = (ScenePresence) scene.Entities[toAgentID];
@@ -405,17 +407,11 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
405 // Trigger the Instant message in the scene. 407 // Trigger the Instant message in the scene.
406 foreach (Scene scene in m_Scenes) 408 foreach (Scene scene in m_Scenes)
407 { 409 {
408 if (scene.Entities.ContainsKey(toAgentID) && 410 ScenePresence sp = scene.GetScenePresence(toAgentID);
409 scene.Entities[toAgentID] is ScenePresence) 411 if (sp != null && !sp.IsChildAgent)
410 { 412 {
411 ScenePresence user = 413 scene.EventManager.TriggerIncomingInstantMessage(gim);
412 (ScenePresence)scene.Entities[toAgentID]; 414 successful = true;
413
414 if (!user.IsChildAgent)
415 {
416 scene.EventManager.TriggerIncomingInstantMessage(gim);
417 successful = true;
418 }
419 } 415 }
420 } 416 }
421 if (!successful) 417 if (!successful)