From beba20846f1935e2769f78fb0c87746cf77a6b50 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Wed, 12 Mar 2014 19:31:04 +0000 Subject: When sending group notices through group messaging, allow the agent ID to use for fetching group data to be different from im.fromAgentID This is because xmlrpcgroups currently always checks visibility for the requesting agent ID (unlike Groups v2, which can accept UUID.Zero) But group notice IMs have a from agent which is the group rather than the sending agent. Further addresses http://opensimulator.org/mantis/view.php?id=7037 --- .../OptionalModules/Avatar/XmlRpcGroups/GroupsMessagingModule.cs | 9 ++++----- .../Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs | 3 ++- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups') 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 } } - public void SendMessageToGroup(GridInstantMessage im, UUID groupID) { - SendMessageToGroup(im, groupID, null); + SendMessageToGroup(im, groupID, new UUID(im.fromAgentID), null); } - public void SendMessageToGroup(GridInstantMessage im, UUID groupID, Func sendCondition) + public void SendMessageToGroup( + GridInstantMessage im, UUID groupID, UUID sendingAgentForGroupCalls, Func sendCondition) { - List groupMembers = m_groupData.GetGroupMembers(new UUID(im.fromAgentID), groupID); + List groupMembers = m_groupData.GetGroupMembers(sendingAgentForGroupCalls, groupID); int groupMembersCount = groupMembers.Count; if (m_messageOnlineAgentsOnly) @@ -489,7 +489,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups #endregion - #region ClientEvents private void OnInstantMessage(IClientAPI remoteClient, GridInstantMessage im) { 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 = CreateGroupNoticeIM(UUID.Zero, NoticeID, (byte)OpenMetaverse.InstantMessageDialog.GroupNotice); if (m_groupsMessagingModule != null) - m_groupsMessagingModule.SendMessageToGroup(msg, GroupID, gmd => gmd.AcceptNotices); + m_groupsMessagingModule.SendMessageToGroup( + msg, GroupID, remoteClient.AgentId, gmd => gmd.AcceptNotices); } } -- cgit v1.1