From 7ee5ee3dfdda7809c1ff3c40d6de2f01e5e207aa Mon Sep 17 00:00:00 2001
From: maxim_productengine <mnikolenko@productengine.com>
Date: Tue, 3 Jul 2018 14:22:15 +0300
Subject: [PATCH] MAINT-8582 FIXED The message "Group is already in the list"
 is not displayed

---
 indra/newview/llfloaterregioninfo.cpp            | 16 +++++++++++++++-
 .../skins/default/xui/en/notifications.xml       |  7 +++++++
 2 files changed, 22 insertions(+), 1 deletion(-)

diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp
index a931351feb3..9f7fa82529e 100644
--- a/indra/newview/llfloaterregioninfo.cpp
+++ b/indra/newview/llfloaterregioninfo.cpp
@@ -3463,6 +3463,20 @@ void LLPanelEstateAccess::onClickRemoveEstateManager()
 // Special case callback for groups, since it has different callback format than names
 void LLPanelEstateAccess::addAllowedGroup2(LLUUID id)
 {
+	LLPanelEstateAccess* panel = LLFloaterRegionInfo::getPanelAccess();
+	if (panel)
+	{
+		LLNameListCtrl* group_list = panel->getChild<LLNameListCtrl>("allowed_group_name_list");
+		LLScrollListItem* item = group_list->getNameItemByAgentId(id);
+		if (item)
+		{
+			LLSD args;
+			args["GROUP"] = item->getColumn(0)->getValue().asString();
+			LLNotificationsUtil::add("GroupIsAlreadyInList", args);
+			return;
+		}
+	}
+	
 	LLSD payload;
 	payload["operation"] = (S32)ESTATE_ACCESS_ALLOWED_GROUP_ADD;
 	payload["dialog_name"] = "EstateAllowedGroupAdd";
@@ -4019,7 +4033,7 @@ void LLPanelEstateAccess::requestEstateGetAccessCoro(std::string url)
 		for (LLSD::array_const_iterator it = result["AllowedGroups"].beginArray(); it != result["AllowedGroups"].endArray(); ++it)
 		{
 			LLUUID id = (*it)["id"].asUUID();
-			allowed_group_name_list->addNameItem(id);
+			allowed_group_name_list->addGroupNameItem(id);
 		}
 		allowed_group_name_list->sortByName(TRUE);
 	}
diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml
index 3d994f73af0..30ae7c1d09a 100644
--- a/indra/newview/skins/default/xui/en/notifications.xml
+++ b/indra/newview/skins/default/xui/en/notifications.xml
@@ -3812,6 +3812,13 @@ Unable to add banned resident to estate manager list.
    type="alertmodal">
 Unable to add estate manager [AGENT] to banned list.
   </notification>
+  
+  <notification
+   icon="alertmodal.tga"
+   name="GroupIsAlreadyInList"
+   type="alertmodal">
+[GROUP] is already in the Allowed Groups list.
+  </notification>
     
   <notification
    icon="alertmodal.tga"
-- 
GitLab