aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Addons/Groups
diff options
context:
space:
mode:
authorKevin Cozens2017-01-06 21:10:09 -0500
committerKevin Cozens2017-01-06 21:15:58 -0500
commit4a18444e6e2965260f02b1fcadf25ce390d3e2bb (patch)
tree3bd9fb430606f1c09673eb65cf629c4df156994e /OpenSim/Addons/Groups
parentOnly apply group creation fee > 0 and pass group name when applying fee (diff)
downloadopensim-SC-4a18444e6e2965260f02b1fcadf25ce390d3e2bb.zip
opensim-SC-4a18444e6e2965260f02b1fcadf25ce390d3e2bb.tar.gz
opensim-SC-4a18444e6e2965260f02b1fcadf25ce390d3e2bb.tar.bz2
opensim-SC-4a18444e6e2965260f02b1fcadf25ce390d3e2bb.tar.xz
Allow avatar to be charged group membership fees when a money module is in use
Diffstat (limited to 'OpenSim/Addons/Groups')
-rw-r--r--OpenSim/Addons/Groups/GroupsModule.cs20
1 files changed, 19 insertions, 1 deletions
diff --git a/OpenSim/Addons/Groups/GroupsModule.cs b/OpenSim/Addons/Groups/GroupsModule.cs
index d3085f6..0e3a172 100644
--- a/OpenSim/Addons/Groups/GroupsModule.cs
+++ b/OpenSim/Addons/Groups/GroupsModule.cs
@@ -979,10 +979,28 @@ namespace OpenSim.Groups
979 { 979 {
980 if (m_debugEnabled) m_log.DebugFormat("[Groups]: {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name); 980 if (m_debugEnabled) m_log.DebugFormat("[Groups]: {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name);
981 981
982 GroupRecord groupRecord = GetGroupRecord(groupID);
983 IMoneyModule money = remoteClient.Scene.RequestModuleInterface<IMoneyModule>();
984
985 // Should check to see if there's an outstanding invitation
986
987 if (money != null && groupRecord.MembershipFee > 0)
988 {
989 // Does the agent have the funds to cover the group join fee?
990 if (!money.AmountCovered(remoteClient.AgentId, groupRecord.MembershipFee))
991 {
992 remoteClient.SendAlertMessage("Insufficient funds to join the group.");
993 remoteClient.SendJoinGroupReply(groupID, false);
994 return;
995 }
996 }
997
982 string reason = string.Empty; 998 string reason = string.Empty;
983 // Should check to see if OpenEnrollment, or if there's an outstanding invitation 999
984 if (m_groupData.AddAgentToGroup(GetRequestingAgentIDStr(remoteClient), GetRequestingAgentIDStr(remoteClient), groupID, UUID.Zero, string.Empty, out reason)) 1000 if (m_groupData.AddAgentToGroup(GetRequestingAgentIDStr(remoteClient), GetRequestingAgentIDStr(remoteClient), groupID, UUID.Zero, string.Empty, out reason))
985 { 1001 {
1002 if (money != null && groupRecord.MembershipFee > 0)
1003 money.ApplyCharge(remoteClient.AgentId, groupRecord.MembershipFee, MoneyTransactionType.GroupJoin, groupRecord.GroupName);
986 1004
987 remoteClient.SendJoinGroupReply(groupID, true); 1005 remoteClient.SendJoinGroupReply(groupID, true);
988 1006