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=70370.8.0.3
parent
7112ee0015
commit
beba20846f
|
@ -83,7 +83,6 @@ namespace OpenSim.Groups
|
||||||
private Dictionary<UUID, List<string>> m_groupsAgentsDroppedFromChatSession = new Dictionary<UUID, List<string>>();
|
private Dictionary<UUID, List<string>> m_groupsAgentsDroppedFromChatSession = new Dictionary<UUID, List<string>>();
|
||||||
private Dictionary<UUID, List<string>> m_groupsAgentsInvitedToChatSession = new Dictionary<UUID, List<string>>();
|
private Dictionary<UUID, List<string>> m_groupsAgentsInvitedToChatSession = new Dictionary<UUID, List<string>>();
|
||||||
|
|
||||||
|
|
||||||
#region Region Module interfaceBase Members
|
#region Region Module interfaceBase Members
|
||||||
|
|
||||||
public void Initialise(IConfigSource config)
|
public void Initialise(IConfigSource config)
|
||||||
|
@ -242,13 +241,18 @@ namespace OpenSim.Groups
|
||||||
|
|
||||||
public void SendMessageToGroup(GridInstantMessage im, UUID groupID)
|
public void SendMessageToGroup(GridInstantMessage im, UUID groupID)
|
||||||
{
|
{
|
||||||
SendMessageToGroup(im, groupID, null);
|
SendMessageToGroup(im, groupID, UUID.Zero, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SendMessageToGroup(GridInstantMessage im, UUID groupID, Func<GroupMembersData, bool> sendCondition)
|
public void SendMessageToGroup(
|
||||||
|
GridInstantMessage im, UUID groupID, UUID sendingAgentForGroupCalls, Func<GroupMembersData, bool> sendCondition)
|
||||||
{
|
{
|
||||||
UUID fromAgentID = new UUID(im.fromAgentID);
|
UUID fromAgentID = new UUID(im.fromAgentID);
|
||||||
|
|
||||||
|
// Unlike current XmlRpcGroups, Groups V2 can accept UUID.Zero when a perms check for the requesting agent
|
||||||
|
// is not necessary.
|
||||||
List<GroupMembersData> groupMembers = m_groupData.GetGroupMembers(UUID.Zero.ToString(), groupID);
|
List<GroupMembersData> groupMembers = m_groupData.GetGroupMembers(UUID.Zero.ToString(), groupID);
|
||||||
|
|
||||||
int groupMembersCount = groupMembers.Count;
|
int groupMembersCount = groupMembers.Count;
|
||||||
PresenceInfo[] onlineAgents = null;
|
PresenceInfo[] onlineAgents = null;
|
||||||
|
|
||||||
|
|
|
@ -83,10 +83,15 @@ namespace OpenSim.Region.Framework.Interfaces
|
||||||
/// dialog - This must be (byte)InstantMessageDialog.SessionSend
|
/// dialog - This must be (byte)InstantMessageDialog.SessionSend
|
||||||
/// </param>
|
/// </param>
|
||||||
/// <param name="groupID"></param>
|
/// <param name="groupID"></param>
|
||||||
|
/// <param name="sendingAgentForGroupCalls">
|
||||||
|
/// The requesting agent to use when querying the groups service. Sometimes this is different from
|
||||||
|
/// im.fromAgentID, with group notices, for example.
|
||||||
|
/// </param>
|
||||||
/// <param name="sendCondition">
|
/// <param name="sendCondition">
|
||||||
/// The condition that must be met by a member for the message to be sent. If null then the message is sent
|
/// The condition that must be met by a member for the message to be sent. If null then the message is sent
|
||||||
/// if the chat session is active.
|
/// if the chat session is active.
|
||||||
/// </param>
|
/// </param>
|
||||||
void SendMessageToGroup(GridInstantMessage im, UUID groupID, Func<GroupMembersData, bool> sendCondition);
|
void SendMessageToGroup(
|
||||||
|
GridInstantMessage im, UUID groupID, UUID sendingAgentForGroupCalls, Func<GroupMembersData, bool> sendCondition);
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -238,15 +238,15 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void SendMessageToGroup(GridInstantMessage im, UUID groupID)
|
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<GroupMembersData, bool> sendCondition)
|
public void SendMessageToGroup(
|
||||||
|
GridInstantMessage im, UUID groupID, UUID sendingAgentForGroupCalls, Func<GroupMembersData, bool> sendCondition)
|
||||||
{
|
{
|
||||||
List<GroupMembersData> groupMembers = m_groupData.GetGroupMembers(new UUID(im.fromAgentID), groupID);
|
List<GroupMembersData> groupMembers = m_groupData.GetGroupMembers(sendingAgentForGroupCalls, groupID);
|
||||||
int groupMembersCount = groupMembers.Count;
|
int groupMembersCount = groupMembers.Count;
|
||||||
|
|
||||||
if (m_messageOnlineAgentsOnly)
|
if (m_messageOnlineAgentsOnly)
|
||||||
|
@ -489,7 +489,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
#region ClientEvents
|
#region ClientEvents
|
||||||
private void OnInstantMessage(IClientAPI remoteClient, GridInstantMessage im)
|
private void OnInstantMessage(IClientAPI remoteClient, GridInstantMessage im)
|
||||||
{
|
{
|
||||||
|
|
|
@ -538,7 +538,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
|
||||||
= CreateGroupNoticeIM(UUID.Zero, NoticeID, (byte)OpenMetaverse.InstantMessageDialog.GroupNotice);
|
= CreateGroupNoticeIM(UUID.Zero, NoticeID, (byte)OpenMetaverse.InstantMessageDialog.GroupNotice);
|
||||||
|
|
||||||
if (m_groupsMessagingModule != null)
|
if (m_groupsMessagingModule != null)
|
||||||
m_groupsMessagingModule.SendMessageToGroup(msg, GroupID, gmd => gmd.AcceptNotices);
|
m_groupsMessagingModule.SendMessageToGroup(
|
||||||
|
msg, GroupID, remoteClient.AgentId, gmd => gmd.AcceptNotices);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue