summaryrefslogtreecommitdiff
path: root/indra/newview/llpanelgroupbulkban.cpp
diff options
context:
space:
mode:
authormaksymsproductengine <maksymsproductengine@lindenlab.com>2014-06-06 07:41:01 +0300
committermaksymsproductengine <maksymsproductengine@lindenlab.com>2014-06-06 07:41:01 +0300
commita0b31c3145b25c1267954dd42d2afa916e5fa046 (patch)
treeeb15042c3411307b205db33bb95dbdc46654485e /indra/newview/llpanelgroupbulkban.cpp
parentf0eb544148456f05bd1c6390542192911df32364 (diff)
MAINT-3389 FIXED [vwr] No visual feedback if you try to ban an already banned agent.
Diffstat (limited to 'indra/newview/llpanelgroupbulkban.cpp')
-rw-r--r--indra/newview/llpanelgroupbulkban.cpp25
1 files changed, 25 insertions, 0 deletions
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 <boost/foreach.hpp>
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);