diff options
author | AndreyL ProductEngine <andreylproductengine@lindenlab.com> | 2015-08-13 07:53:38 +0300 |
---|---|---|
committer | AndreyL ProductEngine <andreylproductengine@lindenlab.com> | 2015-08-13 07:53:38 +0300 |
commit | 9e64435bd2168ce0c9213e7a7fb746da33f5e7e6 (patch) | |
tree | 1c964fbf192b0a788bee340d0e720c08214535ea /indra/newview/llfloaterimcontainer.cpp | |
parent | 7172b76f0e70bcb1c4616f7126c279637e18c675 (diff) |
MAINT-5219 FIXED "Ban Member" from the group chatters list context menu is greyed out
when you have the ability to manage the ban list
Diffstat (limited to 'indra/newview/llfloaterimcontainer.cpp')
-rwxr-xr-x | indra/newview/llfloaterimcontainer.cpp | 42 |
1 files changed, 18 insertions, 24 deletions
diff --git a/indra/newview/llfloaterimcontainer.cpp b/indra/newview/llfloaterimcontainer.cpp index 46fc6ea0cd..f1a6ef78a6 100755 --- a/indra/newview/llfloaterimcontainer.cpp +++ b/indra/newview/llfloaterimcontainer.cpp @@ -1909,22 +1909,28 @@ bool LLFloaterIMContainer::canBanSelectedMember(const LLUUID& participant_uuid) return false; } - if (!gdatap->mMembers.size()) + if (gdatap->mPendingBanRequest) { return false; } - LLGroupMgrGroupData::member_list_t::iterator mi = gdatap->mMembers.find((participant_uuid)); - if (mi == gdatap->mMembers.end()) + if (gdatap->isRoleMemberDataComplete()) { - return false; - } + if (!gdatap->mMembers.size()) + { + return false; + } - LLGroupMemberData* member_data = (*mi).second; - // Is the member an owner? - if ( member_data && member_data->isInRole(gdatap->mOwnerRole) ) - { - return false; + LLGroupMgrGroupData::member_list_t::iterator mi = gdatap->mMembers.find((participant_uuid)); + if (mi != gdatap->mMembers.end()) + { + LLGroupMemberData* member_data = (*mi).second; + // Is the member an owner? + if (member_data && member_data->isInRole(gdatap->mOwnerRole)) + { + return false; + } + } } if( gAgent.hasPowerInGroup(group_uuid, GP_ROLE_REMOVE_MEMBER) && @@ -1952,20 +1958,8 @@ void LLFloaterIMContainer::banSelectedMember(const LLUUID& participant_uuid) LL_WARNS("Groups") << "Unable to get group data for group " << group_uuid << LL_ENDL; return; } - std::vector<LLUUID> ids; - ids.push_back(participant_uuid); - - LLGroupBanData ban_data; - gdatap->createBanEntry(participant_uuid, ban_data); - LLGroupMgr::getInstance()->sendGroupBanRequest(LLGroupMgr::REQUEST_POST, group_uuid, LLGroupMgr::BAN_CREATE, ids); - LLGroupMgr::getInstance()->sendGroupMemberEjects(group_uuid, ids); - LLGroupMgr::getInstance()->sendGroupMembersRequest(group_uuid); - LLSD args; - std::string name; - gCacheName->getFullName(participant_uuid, name); - args["AVATAR_NAME"] = name; - args["GROUP_NAME"] = gdatap->mName; - LLNotifications::instance().add(LLNotification::Params("EjectAvatarFromGroup").substitutions(args)); + + gdatap->banMemberById(participant_uuid); } |