aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsMessagingModule.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsMessagingModule.cs')
-rw-r--r--OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsMessagingModule.cs266
1 files changed, 127 insertions, 139 deletions
diff --git a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsMessagingModule.cs b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsMessagingModule.cs
index 00fe5df..06aad91 100644
--- a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsMessagingModule.cs
+++ b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsMessagingModule.cs
@@ -28,41 +28,30 @@
28using System; 28using System;
29using System.Collections.Generic; 29using System.Collections.Generic;
30using System.Reflection; 30using System.Reflection;
31
32
33using log4net; 31using log4net;
34using Mono.Addins; 32using Mono.Addins;
35using Nini.Config; 33using Nini.Config;
36
37using OpenMetaverse; 34using OpenMetaverse;
38using OpenMetaverse.StructuredData; 35using OpenMetaverse.StructuredData;
39
40using OpenSim.Framework; 36using OpenSim.Framework;
41using OpenSim.Region.CoreModules.Framework.EventQueue; 37using OpenSim.Region.CoreModules.Framework.EventQueue;
42using OpenSim.Region.Framework.Interfaces; 38using OpenSim.Region.Framework.Interfaces;
43using OpenSim.Region.Framework.Scenes; 39using OpenSim.Region.Framework.Scenes;
44 40
45
46using Caps = OpenSim.Framework.Capabilities.Caps; 41using Caps = OpenSim.Framework.Capabilities.Caps;
47 42
48namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups 43namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
49{ 44{
50 [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] 45 [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")]
51 public class GroupsMessagingModule : ISharedRegionModule 46 public class GroupsMessagingModule : ISharedRegionModule, IGroupsMessagingModule
52 { 47 {
53
54 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 48 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
55 49
56 private List<Scene> m_sceneList = new List<Scene>(); 50 private List<Scene> m_sceneList = new List<Scene>();
57 51
58 private IMessageTransferModule m_msgTransferModule = null; 52 private IMessageTransferModule m_msgTransferModule = null;
59 53
60 private IGroupsModule m_groupsModule = null; 54 private IGroupsServicesConnector m_groupData = null;
61
62 // TODO: Move this off to the Groups Server
63 public Dictionary<Guid, List<Guid>> m_agentsInGroupSession = new Dictionary<Guid, List<Guid>>();
64 public Dictionary<Guid, List<Guid>> m_agentsDroppedSession = new Dictionary<Guid, List<Guid>>();
65
66 55
67 // Config Options 56 // Config Options
68 private bool m_groupMessagingEnabled = false; 57 private bool m_groupMessagingEnabled = false;
@@ -108,8 +97,12 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
108 97
109 public void AddRegion(Scene scene) 98 public void AddRegion(Scene scene)
110 { 99 {
111 // NoOp 100 if (!m_groupMessagingEnabled)
101 return;
102
103 scene.RegisterModuleInterface<IGroupsMessagingModule>(this);
112 } 104 }
105
113 public void RegionLoaded(Scene scene) 106 public void RegionLoaded(Scene scene)
114 { 107 {
115 if (!m_groupMessagingEnabled) 108 if (!m_groupMessagingEnabled)
@@ -117,12 +110,12 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
117 110
118 if (m_debugEnabled) m_log.DebugFormat("[GROUPS-MESSAGING]: {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name); 111 if (m_debugEnabled) m_log.DebugFormat("[GROUPS-MESSAGING]: {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name);
119 112
120 m_groupsModule = scene.RequestModuleInterface<IGroupsModule>(); 113 m_groupData = scene.RequestModuleInterface<IGroupsServicesConnector>();
121 114
122 // No groups module, no groups messaging 115 // No groups module, no groups messaging
123 if (m_groupsModule == null) 116 if (m_groupData == null)
124 { 117 {
125 m_log.Error("[GROUPS-MESSAGING]: Could not get IGroupsModule, GroupsMessagingModule is now disabled."); 118 m_log.Error("[GROUPS-MESSAGING]: Could not get IGroupsServicesConnector, GroupsMessagingModule is now disabled.");
126 Close(); 119 Close();
127 m_groupMessagingEnabled = false; 120 m_groupMessagingEnabled = false;
128 return; 121 return;
@@ -144,7 +137,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
144 137
145 scene.EventManager.OnNewClient += OnNewClient; 138 scene.EventManager.OnNewClient += OnNewClient;
146 scene.EventManager.OnIncomingInstantMessage += OnGridInstantMessage; 139 scene.EventManager.OnIncomingInstantMessage += OnGridInstantMessage;
147
148 } 140 }
149 141
150 public void RemoveRegion(Scene scene) 142 public void RemoveRegion(Scene scene)
@@ -172,7 +164,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
172 164
173 m_sceneList.Clear(); 165 m_sceneList.Clear();
174 166
175 m_groupsModule = null; 167 m_groupData = null;
176 m_msgTransferModule = null; 168 m_msgTransferModule = null;
177 } 169 }
178 170
@@ -197,6 +189,75 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
197 189
198 #endregion 190 #endregion
199 191
192 /// <summary>
193 /// Not really needed, but does confirm that the group exists.
194 /// </summary>
195 public bool StartGroupChatSession(UUID agentID, UUID groupID)
196 {
197 if (m_debugEnabled)
198 m_log.DebugFormat("[GROUPS-MESSAGING]: {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name);
199
200 GroupRecord groupInfo = m_groupData.GetGroupRecord(agentID, groupID, null);
201
202 if (groupInfo != null)
203 {
204 return true;
205 }
206 else
207 {
208 return false;
209 }
210 }
211
212 public void SendMessageToGroup(GridInstantMessage im, UUID groupID)
213 {
214 if (m_debugEnabled)
215 m_log.DebugFormat("[GROUPS-MESSAGING]: {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name);
216
217
218 foreach (GroupMembersData member in m_groupData.GetGroupMembers(UUID.Zero, groupID))
219 {
220 if (m_groupData.hasAgentDroppedGroupChatSession(member.AgentID, groupID))
221 {
222 // Don't deliver messages to people who have dropped this session
223 if (m_debugEnabled) m_log.DebugFormat("[GROUPS-MESSAGING]: {0} has dropped session, not delivering to them", member.AgentID);
224 continue;
225 }
226
227 // Copy Message
228 GridInstantMessage msg = new GridInstantMessage();
229 msg.imSessionID = groupID.Guid;
230 msg.fromAgentName = im.fromAgentName;
231 msg.message = im.message;
232 msg.dialog = im.dialog;
233 msg.offline = im.offline;
234 msg.ParentEstateID = im.ParentEstateID;
235 msg.Position = im.Position;
236 msg.RegionID = im.RegionID;
237 msg.binaryBucket = im.binaryBucket;
238 msg.timestamp = (uint)Util.UnixTimeSinceEpoch();
239
240 msg.fromAgentID = im.fromAgentID;
241 msg.fromGroup = true;
242
243 msg.toAgentID = member.AgentID.Guid;
244
245 IClientAPI client = GetActiveClient(member.AgentID);
246 if (client == null)
247 {
248 // If they're not local, forward across the grid
249 if (m_debugEnabled) m_log.DebugFormat("[GROUPS-MESSAGING]: Delivering to {0} via Grid", member.AgentID);
250 m_msgTransferModule.SendInstantMessage(msg, delegate(bool success) { });
251 }
252 else
253 {
254 // Deliver locally, directly
255 if (m_debugEnabled) m_log.DebugFormat("[GROUPS-MESSAGING]: Passing to ProcessMessageFromGroupSession to deliver to {0} locally", client.Name);
256 ProcessMessageFromGroupSession(msg);
257 }
258 }
259 }
260
200 #region SimGridEventHandlers 261 #region SimGridEventHandlers
201 262
202 private void OnNewClient(IClientAPI client) 263 private void OnNewClient(IClientAPI client)
@@ -236,42 +297,46 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
236 { 297 {
237 if (m_debugEnabled) m_log.DebugFormat("[GROUPS-MESSAGING]: Session message from {0} going to agent {1}", msg.fromAgentName, msg.toAgentID); 298 if (m_debugEnabled) m_log.DebugFormat("[GROUPS-MESSAGING]: Session message from {0} going to agent {1}", msg.fromAgentName, msg.toAgentID);
238 299
300 UUID AgentID = new UUID(msg.fromAgentID);
301 UUID GroupID = new UUID(msg.imSessionID);
302
239 switch (msg.dialog) 303 switch (msg.dialog)
240 { 304 {
241 case (byte)InstantMessageDialog.SessionAdd: 305 case (byte)InstantMessageDialog.SessionAdd:
242 AddAgentToGroupSession(msg.fromAgentID, msg.imSessionID); 306 m_groupData.AgentInvitedToGroupChatSession(AgentID, GroupID);
243 break; 307 break;
244 308
245 case (byte)InstantMessageDialog.SessionDrop: 309 case (byte)InstantMessageDialog.SessionDrop:
246 RemoveAgentFromGroupSession(msg.fromAgentID, msg.imSessionID); 310 m_groupData.AgentDroppedFromGroupChatSession(AgentID, GroupID);
247 break; 311 break;
248 312
249 case (byte)InstantMessageDialog.SessionSend: 313 case (byte)InstantMessageDialog.SessionSend:
250 if (!m_agentsInGroupSession.ContainsKey(msg.toAgentID) 314 if (!m_groupData.hasAgentDroppedGroupChatSession(AgentID, GroupID)
251 && !m_agentsDroppedSession.ContainsKey(msg.toAgentID)) 315 && !m_groupData.hasAgentBeenInvitedToGroupChatSession(AgentID, GroupID)
316 )
252 { 317 {
253 // Agent not in session and hasn't dropped from session 318 // Agent not in session and hasn't dropped from session
254 // Add them to the session for now, and Invite them 319 // Add them to the session for now, and Invite them
255 AddAgentToGroupSession(msg.toAgentID, msg.imSessionID); 320 m_groupData.AgentInvitedToGroupChatSession(AgentID, GroupID);
256 321
257 UUID toAgentID = new UUID(msg.toAgentID); 322 UUID toAgentID = new UUID(msg.toAgentID);
258 IClientAPI activeClient = GetActiveClient(toAgentID); 323 IClientAPI activeClient = GetActiveClient(toAgentID);
259 if (activeClient != null) 324 if (activeClient != null)
260 { 325 {
261 UUID groupID = new UUID(msg.fromAgentID); 326 GroupRecord groupInfo = m_groupData.GetGroupRecord(UUID.Zero, GroupID, null);
262
263 GroupRecord groupInfo = m_groupsModule.GetGroupRecord(groupID);
264 if (groupInfo != null) 327 if (groupInfo != null)
265 { 328 {
266 if (m_debugEnabled) m_log.DebugFormat("[GROUPS-MESSAGING]: Sending chatterbox invite instant message"); 329 if (m_debugEnabled) m_log.DebugFormat("[GROUPS-MESSAGING]: Sending chatterbox invite instant message");
267 330
268 // Force? open the group session dialog??? 331 // Force? open the group session dialog???
332 // and simultanously deliver the message, so we don't need to do a seperate client.SendInstantMessage(msg);
269 IEventQueue eq = activeClient.Scene.RequestModuleInterface<IEventQueue>(); 333 IEventQueue eq = activeClient.Scene.RequestModuleInterface<IEventQueue>();
270 eq.ChatterboxInvitation( 334 eq.ChatterboxInvitation(
271 groupID 335 GroupID
272 , groupInfo.GroupName 336 , groupInfo.GroupName
273 , new UUID(msg.fromAgentID) 337 , new UUID(msg.fromAgentID)
274 , msg.message, new UUID(msg.toAgentID) 338 , msg.message
339 , new UUID(msg.toAgentID)
275 , msg.fromAgentName 340 , msg.fromAgentName
276 , msg.dialog 341 , msg.dialog
277 , msg.timestamp 342 , msg.timestamp
@@ -285,7 +350,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
285 ); 350 );
286 351
287 eq.ChatterBoxSessionAgentListUpdates( 352 eq.ChatterBoxSessionAgentListUpdates(
288 new UUID(groupID) 353 new UUID(GroupID)
289 , new UUID(msg.fromAgentID) 354 , new UUID(msg.fromAgentID)
290 , new UUID(msg.toAgentID) 355 , new UUID(msg.toAgentID)
291 , false //canVoiceChat 356 , false //canVoiceChat
@@ -295,7 +360,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
295 } 360 }
296 } 361 }
297 } 362 }
298 else if (!m_agentsDroppedSession.ContainsKey(msg.toAgentID)) 363 else if (!m_groupData.hasAgentDroppedGroupChatSession(AgentID, GroupID))
299 { 364 {
300 // User hasn't dropped, so they're in the session, 365 // User hasn't dropped, so they're in the session,
301 // maybe we should deliver it. 366 // maybe we should deliver it.
@@ -321,56 +386,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
321 386
322 #endregion 387 #endregion
323 388
324 #region ClientEvents
325
326 private void RemoveAgentFromGroupSession(Guid agentID, Guid sessionID)
327 {
328 if (m_agentsInGroupSession.ContainsKey(sessionID))
329 {
330 // If in session remove
331 if (m_agentsInGroupSession[sessionID].Contains(agentID))
332 {
333 m_agentsInGroupSession[sessionID].Remove(agentID);
334 }
335
336 // If not in dropped list, add
337 if (!m_agentsDroppedSession[sessionID].Contains(agentID))
338 {
339 if (m_debugEnabled) m_log.DebugFormat("[GROUPS-MESSAGING]: Dropped {1} from session {0}", sessionID, agentID);
340 m_agentsDroppedSession[sessionID].Add(agentID);
341 }
342 }
343 }
344
345 private void AddAgentToGroupSession(Guid agentID, Guid sessionID)
346 {
347 // Add Session Status if it doesn't exist for this session
348 CreateGroupSessionTracking(sessionID);
349
350 // If nessesary, remove from dropped list
351 if (m_agentsDroppedSession[sessionID].Contains(agentID))
352 {
353 m_agentsDroppedSession[sessionID].Remove(agentID);
354 }
355
356 // If nessesary, add to in session list
357 if (!m_agentsInGroupSession[sessionID].Contains(agentID))
358 {
359 if (m_debugEnabled) m_log.DebugFormat("[GROUPS-MESSAGING]: Added {1} to session {0}", sessionID, agentID);
360 m_agentsInGroupSession[sessionID].Add(agentID);
361 }
362 }
363
364 private void CreateGroupSessionTracking(Guid sessionID)
365 {
366 if (!m_agentsInGroupSession.ContainsKey(sessionID))
367 {
368 if (m_debugEnabled) m_log.DebugFormat("[GROUPS-MESSAGING]: Creating session tracking for : {0}", sessionID);
369 m_agentsInGroupSession.Add(sessionID, new List<Guid>());
370 m_agentsDroppedSession.Add(sessionID, new List<Guid>());
371 }
372 }
373 389
390 #region ClientEvents
374 private void OnInstantMessage(IClientAPI remoteClient, GridInstantMessage im) 391 private void OnInstantMessage(IClientAPI remoteClient, GridInstantMessage im)
375 { 392 {
376 if (m_debugEnabled) 393 if (m_debugEnabled)
@@ -383,21 +400,23 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
383 // Start group IM session 400 // Start group IM session
384 if ((im.dialog == (byte)InstantMessageDialog.SessionGroupStart)) 401 if ((im.dialog == (byte)InstantMessageDialog.SessionGroupStart))
385 { 402 {
386 UUID groupID = new UUID(im.toAgentID); 403 if (m_debugEnabled) m_log.InfoFormat("[GROUPS-MESSAGING]: imSessionID({0}) toAgentID({1})", im.imSessionID, im.toAgentID);
387 404
388 GroupRecord groupInfo = m_groupsModule.GetGroupRecord(groupID); 405 UUID GroupID = new UUID(im.imSessionID);
406 UUID AgentID = new UUID(im.fromAgentID);
407
408 GroupRecord groupInfo = m_groupData.GetGroupRecord(UUID.Zero, GroupID, null);
409
389 if (groupInfo != null) 410 if (groupInfo != null)
390 { 411 {
391 if (m_debugEnabled) m_log.DebugFormat("[GROUPS-MESSAGING]: Start Group Session for {0}", groupInfo.GroupName); 412 m_groupData.AgentInvitedToGroupChatSession(AgentID, GroupID);
392
393 AddAgentToGroupSession(im.fromAgentID, im.imSessionID);
394 413
395 ChatterBoxSessionStartReplyViaCaps(remoteClient, groupInfo.GroupName, groupID); 414 ChatterBoxSessionStartReplyViaCaps(remoteClient, groupInfo.GroupName, GroupID);
396 415
397 IEventQueue queue = remoteClient.Scene.RequestModuleInterface<IEventQueue>(); 416 IEventQueue queue = remoteClient.Scene.RequestModuleInterface<IEventQueue>();
398 queue.ChatterBoxSessionAgentListUpdates( 417 queue.ChatterBoxSessionAgentListUpdates(
399 new UUID(groupID) 418 GroupID
400 , new UUID(im.fromAgentID) 419 , AgentID
401 , new UUID(im.toAgentID) 420 , new UUID(im.toAgentID)
402 , false //canVoiceChat 421 , false //canVoiceChat
403 , false //isModerator 422 , false //isModerator
@@ -409,64 +428,21 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
409 // Send a message from locally connected client to a group 428 // Send a message from locally connected client to a group
410 if ((im.dialog == (byte)InstantMessageDialog.SessionSend)) 429 if ((im.dialog == (byte)InstantMessageDialog.SessionSend))
411 { 430 {
412 UUID groupID = new UUID(im.toAgentID); 431 UUID GroupID = new UUID(im.imSessionID);
432 UUID AgentID = new UUID(im.fromAgentID);
413 433
414 if (m_debugEnabled) m_log.DebugFormat("[GROUPS-MESSAGING]: Send message to session for group {0} with session ID {1}", groupID, im.imSessionID.ToString()); 434 if (m_debugEnabled)
435 m_log.DebugFormat("[GROUPS-MESSAGING]: Send message to session for group {0} with session ID {1}", GroupID, im.imSessionID.ToString());
415 436
416 SendMessageToGroup(im, groupID); 437 //If this agent is sending a message, then they want to be in the session
438 m_groupData.AgentInvitedToGroupChatSession(AgentID, GroupID);
439
440 SendMessageToGroup(im, GroupID);
417 } 441 }
418 } 442 }
419 443
420 #endregion 444 #endregion
421 445
422 private void SendMessageToGroup(GridInstantMessage im, UUID groupID)
423 {
424 if (m_debugEnabled) m_log.DebugFormat("[GROUPS-MESSAGING]: {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name);
425
426 foreach (GroupMembersData member in m_groupsModule.GroupMembersRequest(null, groupID))
427 {
428 if (!m_agentsDroppedSession.ContainsKey(im.imSessionID) || m_agentsDroppedSession[im.imSessionID].Contains(member.AgentID.Guid))
429 {
430 // Don't deliver messages to people who have dropped this session
431 if (m_debugEnabled) m_log.DebugFormat("[GROUPS-MESSAGING]: {0} has dropped session, not delivering to them", member.AgentID);
432 continue;
433 }
434
435 // Copy Message
436 GridInstantMessage msg = new GridInstantMessage();
437 msg.imSessionID = im.imSessionID;
438 msg.fromAgentName = im.fromAgentName;
439 msg.message = im.message;
440 msg.dialog = im.dialog;
441 msg.offline = im.offline;
442 msg.ParentEstateID = im.ParentEstateID;
443 msg.Position = im.Position;
444 msg.RegionID = im.RegionID;
445 msg.binaryBucket = im.binaryBucket;
446 msg.timestamp = (uint)Util.UnixTimeSinceEpoch();
447
448 // Updat Pertinate fields to make it a "group message"
449 msg.fromAgentID = groupID.Guid;
450 msg.fromGroup = true;
451
452 msg.toAgentID = member.AgentID.Guid;
453
454 IClientAPI client = GetActiveClient(member.AgentID);
455 if (client == null)
456 {
457 // If they're not local, forward across the grid
458 if (m_debugEnabled) m_log.DebugFormat("[GROUPS-MESSAGING]: Delivering to {0} via Grid", member.AgentID);
459 m_msgTransferModule.SendInstantMessage(msg, delegate(bool success) { });
460 }
461 else
462 {
463 // Deliver locally, directly
464 if (m_debugEnabled) m_log.DebugFormat("[GROUPS-MESSAGING]: Passing to ProcessMessageFromGroupSession to deliver to {0} locally", client.Name);
465 ProcessMessageFromGroupSession(msg);
466 }
467 }
468 }
469
470 void ChatterBoxSessionStartReplyViaCaps(IClientAPI remoteClient, string groupName, UUID groupID) 446 void ChatterBoxSessionStartReplyViaCaps(IClientAPI remoteClient, string groupName, UUID groupID)
471 { 447 {
472 if (m_debugEnabled) m_log.DebugFormat("[GROUPS-MESSAGING]: {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name); 448 if (m_debugEnabled) m_log.DebugFormat("[GROUPS-MESSAGING]: {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name);
@@ -518,6 +494,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
518 /// </summary> 494 /// </summary>
519 private IClientAPI GetActiveClient(UUID agentID) 495 private IClientAPI GetActiveClient(UUID agentID)
520 { 496 {
497 if (m_debugEnabled) m_log.WarnFormat("[GROUPS-MESSAGING]: Looking for local client {0}", agentID);
498
521 IClientAPI child = null; 499 IClientAPI child = null;
522 500
523 // Try root avatar first 501 // Try root avatar first
@@ -529,16 +507,26 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
529 ScenePresence user = (ScenePresence)scene.Entities[agentID]; 507 ScenePresence user = (ScenePresence)scene.Entities[agentID];
530 if (!user.IsChildAgent) 508 if (!user.IsChildAgent)
531 { 509 {
510 if (m_debugEnabled) m_log.WarnFormat("[GROUPS-MESSAGING]: Found root agent for client : {0}", user.ControllingClient.Name);
532 return user.ControllingClient; 511 return user.ControllingClient;
533 } 512 }
534 else 513 else
535 { 514 {
515 if (m_debugEnabled) m_log.WarnFormat("[GROUPS-MESSAGING]: Found child agent for client : {0}", user.ControllingClient.Name);
536 child = user.ControllingClient; 516 child = user.ControllingClient;
537 } 517 }
538 } 518 }
539 } 519 }
540 520
541 // If we didn't find a root, then just return whichever child we found, or null if none 521 // If we didn't find a root, then just return whichever child we found, or null if none
522 if (child == null)
523 {
524 if (m_debugEnabled) m_log.WarnFormat("[GROUPS-MESSAGING]: Could not find local client for agent : {0}", agentID);
525 }
526 else
527 {
528 if (m_debugEnabled) m_log.WarnFormat("[GROUPS-MESSAGING]: Returning child agent for client : {0}", child.Name);
529 }
542 return child; 530 return child;
543 } 531 }
544 532