diff options
author | UbitUmarov | 2016-07-24 14:44:40 +0100 |
---|---|---|
committer | UbitUmarov | 2016-07-24 14:44:40 +0100 |
commit | 96a5a053ef2983b0fa2cf248b8e270a7db3d978e (patch) | |
tree | bbd8f2b4357671611dfb1c826dfb59d82a8d9ef8 | |
parent | add a coment for improvement of ChatterBoxSessionAgentListUpdates closer to ... (diff) | |
download | opensim-SC_OLD-96a5a053ef2983b0fa2cf248b8e270a7db3d978e.zip opensim-SC_OLD-96a5a053ef2983b0fa2cf248b8e270a7db3d978e.tar.gz opensim-SC_OLD-96a5a053ef2983b0fa2cf248b8e270a7db3d978e.tar.bz2 opensim-SC_OLD-96a5a053ef2983b0fa2cf248b8e270a7db3d978e.tar.xz |
do not send IMs via child agents
-rw-r--r-- | OpenSim/Region/CoreModules/Avatar/InstantMessage/HGMessageTransferModule.cs | 25 | ||||
-rw-r--r-- | OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs | 45 |
2 files changed, 20 insertions, 50 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/InstantMessage/HGMessageTransferModule.cs b/OpenSim/Region/CoreModules/Avatar/InstantMessage/HGMessageTransferModule.cs index a1b918a..63b3dba 100644 --- a/OpenSim/Region/CoreModules/Avatar/InstantMessage/HGMessageTransferModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/InstantMessage/HGMessageTransferModule.cs | |||
@@ -147,7 +147,7 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage | |||
147 | // "[HG INSTANT MESSAGE]: Looking for root agent {0} in {1}", | 147 | // "[HG INSTANT MESSAGE]: Looking for root agent {0} in {1}", |
148 | // toAgentID.ToString(), scene.RegionInfo.RegionName); | 148 | // toAgentID.ToString(), scene.RegionInfo.RegionName); |
149 | ScenePresence sp = scene.GetScenePresence(toAgentID); | 149 | ScenePresence sp = scene.GetScenePresence(toAgentID); |
150 | if (sp != null && !sp.IsChildAgent) | 150 | if (sp != null && !sp.IsChildAgent && !sp.IsDeleted) |
151 | { | 151 | { |
152 | // Local message | 152 | // Local message |
153 | // m_log.DebugFormat("[HG INSTANT MESSAGE]: Delivering IM to root agent {0} {1}", user.Name, toAgentID); | 153 | // m_log.DebugFormat("[HG INSTANT MESSAGE]: Delivering IM to root agent {0} {1}", user.Name, toAgentID); |
@@ -159,25 +159,6 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage | |||
159 | } | 159 | } |
160 | } | 160 | } |
161 | 161 | ||
162 | // try child avatar second | ||
163 | foreach (Scene scene in m_Scenes) | ||
164 | { | ||
165 | // m_log.DebugFormat( | ||
166 | // "[HG INSTANT MESSAGE]: Looking for child of {0} in {1}", | ||
167 | // toAgentID, scene.RegionInfo.RegionName); | ||
168 | ScenePresence sp = scene.GetScenePresence(toAgentID); | ||
169 | if (sp != null) | ||
170 | { | ||
171 | // Local message | ||
172 | // m_log.DebugFormat("[HG INSTANT MESSAGE]: Delivering IM to child agent {0} {1}", user.Name, toAgentID); | ||
173 | sp.ControllingClient.SendInstantMessage(im); | ||
174 | |||
175 | // Message sent | ||
176 | result(true); | ||
177 | return; | ||
178 | } | ||
179 | } | ||
180 | |||
181 | // m_log.DebugFormat("[HG INSTANT MESSAGE]: Delivering IM to {0} via XMLRPC", im.toAgentID); | 162 | // m_log.DebugFormat("[HG INSTANT MESSAGE]: Delivering IM to {0} via XMLRPC", im.toAgentID); |
182 | // Is the user a local user? | 163 | // Is the user a local user? |
183 | string url = string.Empty; | 164 | string url = string.Empty; |
@@ -224,7 +205,7 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage | |||
224 | foreach (Scene scene in m_Scenes) | 205 | foreach (Scene scene in m_Scenes) |
225 | { | 206 | { |
226 | ScenePresence sp = scene.GetScenePresence(toAgentID); | 207 | ScenePresence sp = scene.GetScenePresence(toAgentID); |
227 | if(sp != null && !sp.IsChildAgent) | 208 | if(sp != null && !sp.IsChildAgent && !sp.IsDeleted) |
228 | { | 209 | { |
229 | scene.EventManager.TriggerIncomingInstantMessage(gim); | 210 | scene.EventManager.TriggerIncomingInstantMessage(gim); |
230 | successful = true; | 211 | successful = true; |
@@ -310,7 +291,7 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage | |||
310 | foreach (Scene scene in m_Scenes) | 291 | foreach (Scene scene in m_Scenes) |
311 | { | 292 | { |
312 | ScenePresence presence = scene.GetScenePresence(agentID); | 293 | ScenePresence presence = scene.GetScenePresence(agentID); |
313 | if (presence != null && !presence.IsChildAgent) | 294 | if (presence != null && !presence.IsChildAgent && !presence.IsDeleted) |
314 | return presence.ControllingClient; | 295 | return presence.ControllingClient; |
315 | } | 296 | } |
316 | } | 297 | } |
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); |