From a66e747c95eb2b1fc090142ee5bba973a4ab1079 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Thu, 4 Aug 2016 20:57:57 +0100 Subject: [PATCH] add GetActiveMembershipData() to groups modules, let core groups also have GetMembershipData(), wait for client to ask for it not telling in OnNewClient, as other modules do. --- OpenSim/Addons/Groups/GroupsModule.cs | 6 ++++++ .../CoreModules/Avatar/Groups/GroupsModule.cs | 17 ++++++++++++----- .../Framework/Interfaces/IGroupsModule.cs | 1 + .../Avatar/XmlRpcGroups/GroupsModule.cs | 5 +++++ 4 files changed, 24 insertions(+), 5 deletions(-) diff --git a/OpenSim/Addons/Groups/GroupsModule.cs b/OpenSim/Addons/Groups/GroupsModule.cs index e586dd7f34..b6bf5f1711 100644 --- a/OpenSim/Addons/Groups/GroupsModule.cs +++ b/OpenSim/Addons/Groups/GroupsModule.cs @@ -714,6 +714,12 @@ namespace OpenSim.Groups return m_groupData.GetAgentGroupMembership(UUID.Zero.ToString(), agentID.ToString(), groupID); } + public GroupMembershipData GetActiveMembershipData(UUID agentID) + { + string agentIDstr = agentID.ToString(); + return m_groupData.GetAgentActiveMembership(agentIDstr, agentIDstr); + } + public void UpdateGroupInfo(IClientAPI remoteClient, UUID groupID, string charter, bool showInList, UUID insigniaID, int membershipFee, bool openEnrollment, bool allowPublish, bool maturePublish) { if (m_debugEnabled) m_log.DebugFormat("[Groups]: {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name); diff --git a/OpenSim/Region/CoreModules/Avatar/Groups/GroupsModule.cs b/OpenSim/Region/CoreModules/Avatar/Groups/GroupsModule.cs index b735c611bb..543410ea88 100644 --- a/OpenSim/Region/CoreModules/Avatar/Groups/GroupsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Groups/GroupsModule.cs @@ -182,11 +182,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Groups m_ClientMap.Add(client.AgentId, client); } } - - GroupMembershipData[] updateGroups = new GroupMembershipData[1]; - updateGroups[0] = osGroup; - - client.SendGroupMembership(updateGroups); } private void OnAgentDataUpdateRequest(IClientAPI remoteClient, @@ -237,6 +232,18 @@ namespace OpenSim.Region.CoreModules.Avatar.Groups remote_client.SendGroupNameReply(groupUUID, groupnamereply); } + public GroupMembershipData[] GetMembershipData(UUID agentID) + { + GroupMembershipData[] updateGroups = new GroupMembershipData[1]; + updateGroups[0] = osGroup; + return updateGroups; + } + + public GroupMembershipData GetActiveMembershipData(UUID agentID) + { + return osGroup; + } + private void OnClientClosed(UUID agentID, Scene scene) { lock (m_ClientMap) diff --git a/OpenSim/Region/Framework/Interfaces/IGroupsModule.cs b/OpenSim/Region/Framework/Interfaces/IGroupsModule.cs index 9ae5e8769a..110cb007e5 100644 --- a/OpenSim/Region/Framework/Interfaces/IGroupsModule.cs +++ b/OpenSim/Region/Framework/Interfaces/IGroupsModule.cs @@ -76,6 +76,7 @@ namespace OpenSim.Region.Framework.Interfaces GroupProfileData GroupProfileRequest(IClientAPI remoteClient, UUID groupID); GroupMembershipData[] GetMembershipData(UUID UserID); GroupMembershipData GetMembershipData(UUID GroupID, UUID UserID); + GroupMembershipData GetActiveMembershipData(UUID UserID); void UpdateGroupInfo(IClientAPI remoteClient, UUID groupID, string charter, bool showInList, UUID insigniaID, int membershipFee, bool openEnrollment, bool allowPublish, bool maturePublish); diff --git a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs index 5205eae72c..112a41f549 100644 --- a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs +++ b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs @@ -837,6 +837,11 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups return m_groupData.GetAgentGroupMembership(UUID.Zero, agentID, groupID); } + public GroupMembershipData GetActiveMembershipData(UUID agentID) + { + return m_groupData.GetAgentActiveMembership(agentID, agentID); + } + public void UpdateGroupInfo(IClientAPI remoteClient, UUID groupID, string charter, bool showInList, UUID insigniaID, int membershipFee, bool openEnrollment, bool allowPublish, bool maturePublish) { if (m_debugEnabled) m_log.DebugFormat("[GROUPS]: {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name);