diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Addons/Groups/GroupsModule.cs | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/OpenSim/Addons/Groups/GroupsModule.cs b/OpenSim/Addons/Groups/GroupsModule.cs index aa5105e..0e3a172 100644 --- a/OpenSim/Addons/Groups/GroupsModule.cs +++ b/OpenSim/Addons/Groups/GroupsModule.cs | |||
@@ -781,8 +781,8 @@ namespace OpenSim.Groups | |||
781 | 781 | ||
782 | if (groupID != UUID.Zero) | 782 | if (groupID != UUID.Zero) |
783 | { | 783 | { |
784 | if (money != null) | 784 | if (money != null && money.GroupCreationCharge > 0) |
785 | money.ApplyCharge(remoteClient.AgentId, money.GroupCreationCharge, MoneyTransactionType.GroupCreate); | 785 | money.ApplyCharge(remoteClient.AgentId, money.GroupCreationCharge, MoneyTransactionType.GroupCreate, name); |
786 | 786 | ||
787 | remoteClient.SendCreateGroupReply(groupID, true, "Group created successfully"); | 787 | remoteClient.SendCreateGroupReply(groupID, true, "Group created successfully"); |
788 | 788 | ||
@@ -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 | ||