aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Addons/Groups/GroupsMessagingModule.cs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Addons/Groups/GroupsMessagingModule.cs29
1 files changed, 23 insertions, 6 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