From a0b31c3145b25c1267954dd42d2afa916e5fa046 Mon Sep 17 00:00:00 2001 From: maksymsproductengine Date: Fri, 6 Jun 2014 07:41:01 +0300 Subject: MAINT-3389 FIXED [vwr] No visual feedback if you try to ban an already banned agent. --- indra/newview/llpanelgroupbulkban.cpp | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'indra/newview/llpanelgroupbulkban.cpp') diff --git a/indra/newview/llpanelgroupbulkban.cpp b/indra/newview/llpanelgroupbulkban.cpp index 0b57233f47..a31396737d 100644 --- a/indra/newview/llpanelgroupbulkban.cpp +++ b/indra/newview/llpanelgroupbulkban.cpp @@ -48,6 +48,7 @@ #include "lluictrlfactory.h" #include "llviewerwindow.h" +#include LLPanelGroupBulkBan::LLPanelGroupBulkBan(const LLUUID& group_id) : LLPanelGroupBulk(group_id) { @@ -136,6 +137,30 @@ void LLPanelGroupBulkBan::submit() return; } + LLGroupMgrGroupData * group_datap = LLGroupMgr::getInstance()->getGroupData(mImplementation->mGroupID); + if (group_datap) + { + BOOST_FOREACH(const LLGroupMgrGroupData::ban_list_t::value_type& group_ban_pair, group_datap->mBanList) + { + const LLUUID& group_ban_agent_id = group_ban_pair.first; + if (std::find(banned_agent_list.begin(), banned_agent_list.end(), group_ban_agent_id) != banned_agent_list.end()) + { + // Fail! + LLAvatarName av_name; + LLAvatarNameCache::get(group_ban_agent_id, &av_name); + + LLStringUtil::format_map_t string_args; + string_args["[RESIDENT]"] = av_name.getDisplayName(); + + LLSD msg; + msg["MESSAGE"] = getString("already_banned", string_args); + LLNotificationsUtil::add("GenericAlert", msg); + (*(mImplementation->mCloseCallback))(mImplementation->mCloseCallbackUserData); + return; + } + } + } + LLGroupMgr::getInstance()->sendGroupBanRequest(LLGroupMgr::REQUEST_POST, mImplementation->mGroupID, LLGroupMgr::BAN_CREATE | LLGroupMgr::BAN_UPDATE, banned_agent_list); LLGroupMgr::getInstance()->sendGroupMemberEjects(mImplementation->mGroupID, banned_agent_list); -- cgit v1.2.3