diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Addons/Groups/GroupsMessagingModule.cs | 25 |
1 files changed, 10 insertions, 15 deletions
diff --git a/OpenSim/Addons/Groups/GroupsMessagingModule.cs b/OpenSim/Addons/Groups/GroupsMessagingModule.cs index 5de1fb4..be59c62 100644 --- a/OpenSim/Addons/Groups/GroupsMessagingModule.cs +++ b/OpenSim/Addons/Groups/GroupsMessagingModule.cs | |||
@@ -246,7 +246,7 @@ namespace OpenSim.Groups | |||
246 | public void SendMessageToGroup(GridInstantMessage im, UUID groupID) | 246 | public void SendMessageToGroup(GridInstantMessage im, UUID groupID) |
247 | { | 247 | { |
248 | UUID fromAgentID = new UUID(im.fromAgentID); | 248 | UUID fromAgentID = new UUID(im.fromAgentID); |
249 | List<GroupMembersData> groupMembers = m_groupData.GetGroupMembers("all", groupID); | 249 | List<GroupMembersData> groupMembers = m_groupData.GetGroupMembers(UUID.Zero.ToString(), groupID); |
250 | int groupMembersCount = groupMembers.Count; | 250 | int groupMembersCount = groupMembers.Count; |
251 | PresenceInfo[] onlineAgents = null; | 251 | PresenceInfo[] onlineAgents = null; |
252 | 252 | ||
@@ -297,6 +297,10 @@ namespace OpenSim.Groups | |||
297 | if (member.AgentID.Guid == im.fromAgentID) | 297 | if (member.AgentID.Guid == im.fromAgentID) |
298 | continue; | 298 | continue; |
299 | 299 | ||
300 | if (clientsAlreadySent.Contains(member.AgentID)) | ||
301 | continue; | ||
302 | clientsAlreadySent.Add(member.AgentID); | ||
303 | |||
300 | if (hasAgentDroppedGroupChatSession(member.AgentID.ToString(), groupID)) | 304 | if (hasAgentDroppedGroupChatSession(member.AgentID.ToString(), groupID)) |
301 | { | 305 | { |
302 | // Don't deliver messages to people who have dropped this session | 306 | // Don't deliver messages to people who have dropped this session |
@@ -336,12 +340,9 @@ namespace OpenSim.Groups | |||
336 | // Deliver locally, directly | 340 | // Deliver locally, directly |
337 | if (m_debugEnabled) m_log.DebugFormat("[Groups.Messaging]: Passing to ProcessMessageFromGroupSession to deliver to {0} locally", client.Name); | 341 | if (m_debugEnabled) m_log.DebugFormat("[Groups.Messaging]: Passing to ProcessMessageFromGroupSession to deliver to {0} locally", client.Name); |
338 | 342 | ||
339 | if (clientsAlreadySent.Contains(member.AgentID)) | ||
340 | continue; | ||
341 | clientsAlreadySent.Add(member.AgentID); | ||
342 | |||
343 | ProcessMessageFromGroupSession(im); | 343 | ProcessMessageFromGroupSession(im); |
344 | } | 344 | } |
345 | |||
345 | } | 346 | } |
346 | 347 | ||
347 | if (m_debugEnabled) | 348 | if (m_debugEnabled) |
@@ -403,8 +404,7 @@ namespace OpenSim.Groups | |||
403 | Scene aScene = m_sceneList[0]; | 404 | Scene aScene = m_sceneList[0]; |
404 | GridRegion regionOfOrigin = aScene.GridService.GetRegionByUUID(aScene.RegionInfo.ScopeID, regionID); | 405 | GridRegion regionOfOrigin = aScene.GridService.GetRegionByUUID(aScene.RegionInfo.ScopeID, regionID); |
405 | 406 | ||
406 | List<GroupMembersData> groupMembers = m_groupData.GetGroupMembers("all", GroupID); | 407 | List<GroupMembersData> groupMembers = m_groupData.GetGroupMembers(UUID.Zero.ToString(), GroupID); |
407 | List<UUID> alreadySeen = new List<UUID>(); | ||
408 | 408 | ||
409 | //if (m_debugEnabled) | 409 | //if (m_debugEnabled) |
410 | // foreach (GroupMembersData m in groupMembers) | 410 | // foreach (GroupMembersData m in groupMembers) |
@@ -414,15 +414,10 @@ namespace OpenSim.Groups | |||
414 | { | 414 | { |
415 | s.ForEachScenePresence(sp => | 415 | s.ForEachScenePresence(sp => |
416 | { | 416 | { |
417 | // We need this, because we are searching through all | 417 | // If we got this via grid messaging, it's because the caller thinks |
418 | // SPs, both root and children | 418 | // that the root agent is here. We should only send the IM to root agents. |
419 | if (alreadySeen.Contains(sp.UUID)) | 419 | if (sp.IsChildAgent) |
420 | { | ||
421 | if (m_debugEnabled) | ||
422 | m_log.DebugFormat("[Groups.Messaging]: skipping agent {0} because we've already seen it", sp.UUID); | ||
423 | return; | 420 | return; |
424 | } | ||
425 | alreadySeen.Add(sp.UUID); | ||
426 | 421 | ||
427 | GroupMembersData m = groupMembers.Find(gmd => | 422 | GroupMembersData m = groupMembers.Find(gmd => |
428 | { | 423 | { |