aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs
diff options
context:
space:
mode:
authorUbitUmarov2016-07-24 14:44:40 +0100
committerUbitUmarov2016-07-24 14:44:40 +0100
commit96a5a053ef2983b0fa2cf248b8e270a7db3d978e (patch)
treebbd8f2b4357671611dfb1c826dfb59d82a8d9ef8 /OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs
parent add a coment for improvement of ChatterBoxSessionAgentListUpdates closer to ... (diff)
downloadopensim-SC-96a5a053ef2983b0fa2cf248b8e270a7db3d978e.zip
opensim-SC-96a5a053ef2983b0fa2cf248b8e270a7db3d978e.tar.gz
opensim-SC-96a5a053ef2983b0fa2cf248b8e270a7db3d978e.tar.bz2
opensim-SC-96a5a053ef2983b0fa2cf248b8e270a7db3d978e.tar.xz
do not send IMs via child agents
Diffstat (limited to 'OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs')
-rw-r--r--OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs45
1 files changed, 17 insertions, 28 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs b/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs
index 3c82fd9..6958905 100644
--- a/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs
@@ -142,47 +142,36 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
142 if (toAgentID == UUID.Zero) 142 if (toAgentID == UUID.Zero)
143 return; 143 return;
144 144
145 IClientAPI client = null;
146
145 // Try root avatar only first 147 // Try root avatar only first
146 foreach (Scene scene in m_Scenes) 148 foreach (Scene scene in m_Scenes)
147 { 149 {
148// m_log.DebugFormat(
149// "[INSTANT MESSAGE]: Looking for root agent {0} in {1}",
150// toAgentID.ToString(), scene.RegionInfo.RegionName);
151
152 ScenePresence sp = scene.GetScenePresence(toAgentID); 150 ScenePresence sp = scene.GetScenePresence(toAgentID);
153 if (sp != null && !sp.IsChildAgent) 151 if (sp != null && !sp.IsDeleted && sp.ControllingClient.IsActive)
154 { 152 {
155 // Local message 153 // actualy don't send via child agents
156// m_log.DebugFormat("[INSTANT MESSAGE]: Delivering IM to root agent {0} {1}", sp.Name, toAgentID); 154 // ims can be complex things, and not sure viewers will not mess up
157 155 if(sp.IsChildAgent)
158 sp.ControllingClient.SendInstantMessage(im); 156 continue;
159 157
160 // Message sent 158 client = sp.ControllingClient;
161 result(true); 159 if(!sp.IsChildAgent)
162 return; 160 break;
163 } 161 }
164 } 162 }
165 163
166 // try child avatar second 164 if(client != null)
167 foreach (Scene scene in m_Scenes)
168 { 165 {
169// m_log.DebugFormat( 166 // Local message
170// "[INSTANT MESSAGE]: Looking for child of {0} in {1}", toAgentID, scene.RegionInfo.RegionName); 167// m_log.DebugFormat("[INSTANT MESSAGE]: Delivering IM to root agent {0} {1}", sp.Name, toAgentID);
171
172 ScenePresence sp = scene.GetScenePresence(toAgentID);
173 if (sp != null)
174 {
175 // Local message
176// m_log.DebugFormat("[INSTANT MESSAGE]: Delivering IM to child agent {0} {1}", sp.Name, toAgentID);
177 168
178 sp.ControllingClient.SendInstantMessage(im); 169 client.SendInstantMessage(im);
179 170
180 // Message sent 171 // Message sent
181 result(true); 172 result(true);
182 return; 173 return;
183 }
184 } 174 }
185
186// m_log.DebugFormat("[INSTANT MESSAGE]: Delivering IM to {0} via XMLRPC", im.toAgentID); 175// m_log.DebugFormat("[INSTANT MESSAGE]: Delivering IM to {0} via XMLRPC", im.toAgentID);
187 176
188 SendGridInstantMessageViaXMLRPC(im, result); 177 SendGridInstantMessageViaXMLRPC(im, result);