diff options
Diffstat (limited to 'OpenSim')
4 files changed, 19 insertions, 10 deletions
diff --git a/OpenSim/Addons/Groups/GroupsMessagingModule.cs b/OpenSim/Addons/Groups/GroupsMessagingModule.cs index f701e48..92528a2 100644 --- a/OpenSim/Addons/Groups/GroupsMessagingModule.cs +++ b/OpenSim/Addons/Groups/GroupsMessagingModule.cs | |||
@@ -83,7 +83,6 @@ namespace OpenSim.Groups | |||
83 | private Dictionary<UUID, List<string>> m_groupsAgentsDroppedFromChatSession = new Dictionary<UUID, List<string>>(); | 83 | private Dictionary<UUID, List<string>> m_groupsAgentsDroppedFromChatSession = new Dictionary<UUID, List<string>>(); |
84 | private Dictionary<UUID, List<string>> m_groupsAgentsInvitedToChatSession = new Dictionary<UUID, List<string>>(); | 84 | private Dictionary<UUID, List<string>> m_groupsAgentsInvitedToChatSession = new Dictionary<UUID, List<string>>(); |
85 | 85 | ||
86 | |||
87 | #region Region Module interfaceBase Members | 86 | #region Region Module interfaceBase Members |
88 | 87 | ||
89 | public void Initialise(IConfigSource config) | 88 | public void Initialise(IConfigSource config) |
@@ -242,13 +241,18 @@ namespace OpenSim.Groups | |||
242 | 241 | ||
243 | public void SendMessageToGroup(GridInstantMessage im, UUID groupID) | 242 | public void SendMessageToGroup(GridInstantMessage im, UUID groupID) |
244 | { | 243 | { |
245 | SendMessageToGroup(im, groupID, null); | 244 | SendMessageToGroup(im, groupID, UUID.Zero, null); |
246 | } | 245 | } |
247 | 246 | ||
248 | public void SendMessageToGroup(GridInstantMessage im, UUID groupID, Func<GroupMembersData, bool> sendCondition) | 247 | public void SendMessageToGroup( |
248 | GridInstantMessage im, UUID groupID, UUID sendingAgentForGroupCalls, Func<GroupMembersData, bool> sendCondition) | ||
249 | { | 249 | { |
250 | UUID fromAgentID = new UUID(im.fromAgentID); | 250 | UUID fromAgentID = new UUID(im.fromAgentID); |
251 | |||
252 | // Unlike current XmlRpcGroups, Groups V2 can accept UUID.Zero when a perms check for the requesting agent | ||
253 | // is not necessary. | ||
251 | List<GroupMembersData> groupMembers = m_groupData.GetGroupMembers(UUID.Zero.ToString(), groupID); | 254 | List<GroupMembersData> groupMembers = m_groupData.GetGroupMembers(UUID.Zero.ToString(), groupID); |
255 | |||
252 | int groupMembersCount = groupMembers.Count; | 256 | int groupMembersCount = groupMembers.Count; |
253 | PresenceInfo[] onlineAgents = null; | 257 | PresenceInfo[] onlineAgents = null; |
254 | 258 | ||
diff --git a/OpenSim/Region/Framework/Interfaces/IGroupsMessagingModule.cs b/OpenSim/Region/Framework/Interfaces/IGroupsMessagingModule.cs index 61bd153..7dc1552 100644 --- a/OpenSim/Region/Framework/Interfaces/IGroupsMessagingModule.cs +++ b/OpenSim/Region/Framework/Interfaces/IGroupsMessagingModule.cs | |||
@@ -83,10 +83,15 @@ namespace OpenSim.Region.Framework.Interfaces | |||
83 | /// dialog - This must be (byte)InstantMessageDialog.SessionSend | 83 | /// dialog - This must be (byte)InstantMessageDialog.SessionSend |
84 | /// </param> | 84 | /// </param> |
85 | /// <param name="groupID"></param> | 85 | /// <param name="groupID"></param> |
86 | /// <param name="sendingAgentForGroupCalls"> | ||
87 | /// The requesting agent to use when querying the groups service. Sometimes this is different from | ||
88 | /// im.fromAgentID, with group notices, for example. | ||
89 | /// </param> | ||
86 | /// <param name="sendCondition"> | 90 | /// <param name="sendCondition"> |
87 | /// The condition that must be met by a member for the message to be sent. If null then the message is sent | 91 | /// The condition that must be met by a member for the message to be sent. If null then the message is sent |
88 | /// if the chat session is active. | 92 | /// if the chat session is active. |
89 | /// </param> | 93 | /// </param> |
90 | void SendMessageToGroup(GridInstantMessage im, UUID groupID, Func<GroupMembersData, bool> sendCondition); | 94 | void SendMessageToGroup( |
95 | GridInstantMessage im, UUID groupID, UUID sendingAgentForGroupCalls, Func<GroupMembersData, bool> sendCondition); | ||
91 | } | 96 | } |
92 | } \ No newline at end of file | 97 | } \ No newline at end of file |
diff --git a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsMessagingModule.cs b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsMessagingModule.cs index 741a98f..fd804cd 100644 --- a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsMessagingModule.cs +++ b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsMessagingModule.cs | |||
@@ -238,15 +238,15 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups | |||
238 | } | 238 | } |
239 | } | 239 | } |
240 | 240 | ||
241 | |||
242 | public void SendMessageToGroup(GridInstantMessage im, UUID groupID) | 241 | public void SendMessageToGroup(GridInstantMessage im, UUID groupID) |
243 | { | 242 | { |
244 | SendMessageToGroup(im, groupID, null); | 243 | SendMessageToGroup(im, groupID, new UUID(im.fromAgentID), null); |
245 | } | 244 | } |
246 | 245 | ||
247 | public void SendMessageToGroup(GridInstantMessage im, UUID groupID, Func<GroupMembersData, bool> sendCondition) | 246 | public void SendMessageToGroup( |
247 | GridInstantMessage im, UUID groupID, UUID sendingAgentForGroupCalls, Func<GroupMembersData, bool> sendCondition) | ||
248 | { | 248 | { |
249 | List<GroupMembersData> groupMembers = m_groupData.GetGroupMembers(new UUID(im.fromAgentID), groupID); | 249 | List<GroupMembersData> groupMembers = m_groupData.GetGroupMembers(sendingAgentForGroupCalls, groupID); |
250 | int groupMembersCount = groupMembers.Count; | 250 | int groupMembersCount = groupMembers.Count; |
251 | 251 | ||
252 | if (m_messageOnlineAgentsOnly) | 252 | if (m_messageOnlineAgentsOnly) |
@@ -489,7 +489,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups | |||
489 | 489 | ||
490 | #endregion | 490 | #endregion |
491 | 491 | ||
492 | |||
493 | #region ClientEvents | 492 | #region ClientEvents |
494 | private void OnInstantMessage(IClientAPI remoteClient, GridInstantMessage im) | 493 | private void OnInstantMessage(IClientAPI remoteClient, GridInstantMessage im) |
495 | { | 494 | { |
diff --git a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs index d4f70a7..fc8cae2 100644 --- a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs +++ b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs | |||
@@ -538,7 +538,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups | |||
538 | = CreateGroupNoticeIM(UUID.Zero, NoticeID, (byte)OpenMetaverse.InstantMessageDialog.GroupNotice); | 538 | = CreateGroupNoticeIM(UUID.Zero, NoticeID, (byte)OpenMetaverse.InstantMessageDialog.GroupNotice); |
539 | 539 | ||
540 | if (m_groupsMessagingModule != null) | 540 | if (m_groupsMessagingModule != null) |
541 | m_groupsMessagingModule.SendMessageToGroup(msg, GroupID, gmd => gmd.AcceptNotices); | 541 | m_groupsMessagingModule.SendMessageToGroup( |
542 | msg, GroupID, remoteClient.AgentId, gmd => gmd.AcceptNotices); | ||
542 | } | 543 | } |
543 | } | 544 | } |
544 | 545 | ||