Change SimianGroupsServicesConnectorModule.GetAgentGroupMembership() so that it returns null if the user isn't a member of the group.
This matches the behaviour of the same method for Flotsam Groups. This is the behaviour assumed by existing code. Method doc also added to IGroupsServicesConnector to the make the contract clear.0.7.1-dev
parent
8f008f394d
commit
0898be5750
|
@ -63,7 +63,26 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
|
|||
void SetAgentActiveGroupRole(UUID RequestingAgentID, UUID AgentID, UUID GroupID, UUID RoleID);
|
||||
void SetAgentGroupInfo(UUID RequestingAgentID, UUID AgentID, UUID GroupID, bool AcceptNotices, bool ListInProfile);
|
||||
|
||||
/// <summary>
|
||||
/// Get information about a specific group to which the user belongs.
|
||||
/// </summary>
|
||||
/// <param name="RequestingAgentID">The agent requesting the information.</param>
|
||||
/// <param name="AgentID">The agent requested.</param>
|
||||
/// <param name="GroupID">The group requested.</param>
|
||||
/// <returns>
|
||||
/// If the user is a member of the group then the data structure is returned. If not, then null is returned.
|
||||
/// </returns>
|
||||
GroupMembershipData GetAgentGroupMembership(UUID RequestingAgentID, UUID AgentID, UUID GroupID);
|
||||
|
||||
/// <summary>
|
||||
/// Get information about the groups to which a user belongs.
|
||||
/// </summary>
|
||||
/// <param name="RequestingAgentID">The agent requesting the information.</param>
|
||||
/// <param name="AgentID">The agent requested.</param>
|
||||
/// <returns>
|
||||
/// Information about the groups to which the user belongs. If the user belongs to no groups then an empty
|
||||
/// list is returned.
|
||||
/// </returns>
|
||||
List<GroupMembershipData> GetAgentGroupMemberships(UUID RequestingAgentID, UUID AgentID);
|
||||
|
||||
void AddGroupNotice(UUID RequestingAgentID, UUID groupID, UUID noticeID, string fromName, string subject, string message, byte[] binaryBucket);
|
||||
|
|
|
@ -704,7 +704,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
return findings;
|
||||
}
|
||||
|
||||
|
@ -712,7 +711,17 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
|
|||
{
|
||||
if (m_debugEnabled) m_log.InfoFormat("[SIMIAN-GROUPS-CONNECTOR] {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name);
|
||||
|
||||
GroupMembershipData data = new GroupMembershipData();
|
||||
GroupMembershipData data = null;
|
||||
bool foundData = false;
|
||||
|
||||
OSDMap UserGroupMemberInfo;
|
||||
if (SimianGetGenericEntry(agentID, "GroupMember", groupID.ToString(), out UserGroupMemberInfo))
|
||||
{
|
||||
data = new GroupMembershipData();
|
||||
data.AcceptNotices = UserGroupMemberInfo["AcceptNotices"].AsBoolean();
|
||||
data.Contribution = UserGroupMemberInfo["Contribution"].AsInteger();
|
||||
data.ListInProfile = UserGroupMemberInfo["ListInProfile"].AsBoolean();
|
||||
data.ActiveRole = UserGroupMemberInfo["SelectedRoleID"].AsUUID();
|
||||
|
||||
///////////////////////////////
|
||||
// Agent Specific Information:
|
||||
|
@ -723,25 +732,15 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
|
|||
data.Active = UserActiveGroup["GroupID"].AsUUID().Equals(groupID);
|
||||
}
|
||||
|
||||
OSDMap UserGroupMemberInfo;
|
||||
if (SimianGetGenericEntry(agentID, "GroupMember", groupID.ToString(), out UserGroupMemberInfo))
|
||||
{
|
||||
data.AcceptNotices = UserGroupMemberInfo["AcceptNotices"].AsBoolean();
|
||||
data.Contribution = UserGroupMemberInfo["Contribution"].AsInteger();
|
||||
data.ListInProfile = UserGroupMemberInfo["ListInProfile"].AsBoolean();
|
||||
data.ActiveRole = UserGroupMemberInfo["SelectedRoleID"].AsUUID();
|
||||
|
||||
///////////////////////////////
|
||||
// Role Specific Information:
|
||||
//
|
||||
|
||||
OSDMap GroupRoleInfo;
|
||||
if (SimianGetGenericEntry(groupID, "GroupRole", data.ActiveRole.ToString(), out GroupRoleInfo))
|
||||
{
|
||||
data.GroupTitle = GroupRoleInfo["Title"].AsString();
|
||||
data.GroupPowers = GroupRoleInfo["Powers"].AsULong();
|
||||
}
|
||||
}
|
||||
|
||||
///////////////////////////////
|
||||
// Group Specific Information:
|
||||
|
@ -761,6 +760,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
|
|||
data.OpenEnrollment = GroupInfo["OpenEnrollment"].AsBoolean();
|
||||
data.ShowInList = GroupInfo["ShowInList"].AsBoolean();
|
||||
}
|
||||
}
|
||||
|
||||
return data;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue