aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Addons
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Addons')
-rw-r--r--OpenSim/Addons/Groups/GroupsMessagingModule.cs29
-rw-r--r--OpenSim/Addons/Groups/GroupsModule.cs4
2 files changed, 24 insertions, 9 deletions
diff --git a/OpenSim/Addons/Groups/GroupsMessagingModule.cs b/OpenSim/Addons/Groups/GroupsMessagingModule.cs
index be59c62..f701e48 100644
--- a/OpenSim/Addons/Groups/GroupsMessagingModule.cs
+++ b/OpenSim/Addons/Groups/GroupsMessagingModule.cs
@@ -172,10 +172,8 @@ namespace OpenSim.Groups
172 return; 172 return;
173 } 173 }
174 174
175
176 if (m_presenceService == null) 175 if (m_presenceService == null)
177 m_presenceService = scene.PresenceService; 176 m_presenceService = scene.PresenceService;
178
179 } 177 }
180 178
181 public void RemoveRegion(Scene scene) 179 public void RemoveRegion(Scene scene)
@@ -222,7 +220,6 @@ namespace OpenSim.Groups
222 220
223 #endregion 221 #endregion
224 222
225
226 /// <summary> 223 /// <summary>
227 /// Not really needed, but does confirm that the group exists. 224 /// Not really needed, but does confirm that the group exists.
228 /// </summary> 225 /// </summary>
@@ -242,9 +239,14 @@ namespace OpenSim.Groups
242 return false; 239 return false;
243 } 240 }
244 } 241 }
245 242
246 public void SendMessageToGroup(GridInstantMessage im, UUID groupID) 243 public void SendMessageToGroup(GridInstantMessage im, UUID groupID)
247 { 244 {
245 SendMessageToGroup(im, groupID, null);
246 }
247
248 public void SendMessageToGroup(GridInstantMessage im, UUID groupID, Func<GroupMembersData, bool> sendCondition)
249 {
248 UUID fromAgentID = new UUID(im.fromAgentID); 250 UUID fromAgentID = new UUID(im.fromAgentID);
249 List<GroupMembersData> groupMembers = m_groupData.GetGroupMembers(UUID.Zero.ToString(), groupID); 251 List<GroupMembersData> groupMembers = m_groupData.GetGroupMembers(UUID.Zero.ToString(), groupID);
250 int groupMembersCount = groupMembers.Count; 252 int groupMembersCount = groupMembers.Count;
@@ -299,12 +301,27 @@ namespace OpenSim.Groups
299 301
300 if (clientsAlreadySent.Contains(member.AgentID)) 302 if (clientsAlreadySent.Contains(member.AgentID))
301 continue; 303 continue;
304
302 clientsAlreadySent.Add(member.AgentID); 305 clientsAlreadySent.Add(member.AgentID);
303 306
304 if (hasAgentDroppedGroupChatSession(member.AgentID.ToString(), groupID)) 307 if (sendCondition != null)
308 {
309 if (!sendCondition(member))
310 {
311 if (m_debugEnabled)
312 m_log.DebugFormat(
313 "[Groups.Messaging]: Not sending to {0} as they do not fulfill send condition",
314 member.AgentID);
315
316 continue;
317 }
318 }
319 else if (hasAgentDroppedGroupChatSession(member.AgentID.ToString(), groupID))
305 { 320 {
306 // Don't deliver messages to people who have dropped this session 321 // Don't deliver messages to people who have dropped this session
307 if (m_debugEnabled) m_log.DebugFormat("[Groups.Messaging]: {0} has dropped session, not delivering to them", member.AgentID); 322 if (m_debugEnabled)
323 m_log.DebugFormat("[Groups.Messaging]: {0} has dropped session, not delivering to them", member.AgentID);
324
308 continue; 325 continue;
309 } 326 }
310 327
diff --git a/OpenSim/Addons/Groups/GroupsModule.cs b/OpenSim/Addons/Groups/GroupsModule.cs
index b0493fa..7f453db 100644
--- a/OpenSim/Addons/Groups/GroupsModule.cs
+++ b/OpenSim/Addons/Groups/GroupsModule.cs
@@ -45,9 +45,6 @@ namespace OpenSim.Groups
45 [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "GroupsModule")] 45 [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "GroupsModule")]
46 public class GroupsModule : ISharedRegionModule, IGroupsModule 46 public class GroupsModule : ISharedRegionModule, IGroupsModule
47 { 47 {
48 /// <summary>
49 /// </summary>
50
51 private static readonly ILog m_log = 48 private static readonly ILog m_log =
52 LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 49 LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
53 50
@@ -466,6 +463,7 @@ namespace OpenSim.Groups
466 OnNewGroupNotice(GroupID, NoticeID); 463 OnNewGroupNotice(GroupID, NoticeID);
467 } 464 }
468 465
466
469 // Send notice out to everyone that wants notices 467 // Send notice out to everyone that wants notices
470 foreach (GroupMembersData member in m_groupData.GetGroupMembers(GetRequestingAgentIDStr(remoteClient), GroupID)) 468 foreach (GroupMembersData member in m_groupData.GetGroupMembers(GetRequestingAgentIDStr(remoteClient), GroupID))
471 { 469 {