From b29c7173c68707c7173c5bc26e54047e8f751c15 Mon Sep 17 00:00:00 2001
From: AndreyL ProductEngine <alihatskiy@productengine.com>
Date: Wed, 16 May 2018 23:50:57 +0300
Subject: MAINT-8581 Better handling of adding Estate Managers to Banned list

---
 indra/newview/llfloaterregioninfo.cpp | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

(limited to 'indra/newview/llfloaterregioninfo.cpp')

diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp
index c6271209a8..1d7c13109d 100644
--- a/indra/newview/llfloaterregioninfo.cpp
+++ b/indra/newview/llfloaterregioninfo.cpp
@@ -3587,6 +3587,7 @@ void LLPanelEstateAccess::accessAddCore3(const uuid_vec_t& ids, void* data)
 	if (change_info->mOperationFlag & ESTATE_ACCESS_BANNED_AGENT_ADD)
 	{
 		LLNameListCtrl* name_list = panel->getChild<LLNameListCtrl>("banned_avatar_name_list");
+		LLNameListCtrl* em_list = panel->getChild<LLNameListCtrl>("estate_manager_name_list");
 		int currentCount = (name_list ? name_list->getItemCount() : 0);
 		if (ids.size() + currentCount > ESTATE_MAX_ACCESS_IDS)
 		{
@@ -3601,9 +3602,17 @@ void LLPanelEstateAccess::accessAddCore3(const uuid_vec_t& ids, void* data)
 		}
 
 		std::string already_banned;
+		std::string em_ban;
 		bool single = true;
 		for (uuid_vec_t::const_iterator it = ids.begin(); it != ids.end(); ++it)
 		{
+			LLScrollListItem* em_item = em_list->getNameItemByAgentId(*it);
+			if (em_item)
+			{
+				em_ban = em_item->getColumn(0)->getValue().asString();
+				break;
+			}
+
 			LLScrollListItem* item = name_list->getNameItemByAgentId(*it);
 			if (item)
 			{
@@ -3615,6 +3624,14 @@ void LLPanelEstateAccess::accessAddCore3(const uuid_vec_t& ids, void* data)
 				already_banned += item->getColumn(0)->getValue().asString();
 			}
 		}
+		if (!em_ban.empty())
+		{
+			LLSD args;
+			args["AGENT"] = em_ban;
+			LLNotificationsUtil::add("ProblemBanningEstateManager", args);
+			delete change_info;
+			return;
+		}
 		if (!already_banned.empty())
 		{
 			LLSD args;
-- 
cgit v1.2.3