diff options
Diffstat (limited to 'OpenSim/Addons')
-rw-r--r-- | OpenSim/Addons/Groups/GroupsModule.cs | 20 |
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 | ||