From 4fcf7569cd42bf5bae73f42119aabcaea356e251 Mon Sep 17 00:00:00 2001
From: Andrew Polunin <apolunin@productengine.com>
Date: Thu, 26 Nov 2009 19:30:41 +0200
Subject: [PATCH] Partial fix for normal bug EXT-2619 \"Invalid IM session is
 opened when resident ejects a member from group\": a toast was implemented,
 but adding a record to the Group Chat history was not because of known issue
 EXT-2884 \"Initiation of a voice call should not bring text chat (p2p,
 ad-hoc, group)\".

--HG--
branch : product-engine
---
 indra/newview/llpanelgrouproles.cpp           | 23 +++++++++++++++++++
 indra/newview/llpanelgrouproles.h             |  1 +
 .../skins/default/xui/en/notifications.xml    |  7 ++++++
 3 files changed, 31 insertions(+)

diff --git a/indra/newview/llpanelgrouproles.cpp b/indra/newview/llpanelgrouproles.cpp
index 020c25c8ac3..70b4858a4be 100644
--- a/indra/newview/llpanelgrouproles.cpp
+++ b/indra/newview/llpanelgrouproles.cpp
@@ -1101,10 +1101,33 @@ void LLPanelGroupMembersSubTab::handleEjectMembers()
 
 	mMembersList->deleteSelectedItems();
 
+	sendEjectNotifications(mGroupID, selected_members);
+
 	LLGroupMgr::getInstance()->sendGroupMemberEjects(mGroupID,
 									 selected_members);
 }
 
+void LLPanelGroupMembersSubTab::sendEjectNotifications(const LLUUID& group_id, const std::vector<LLUUID>& selected_members)
+{
+	LLGroupMgrGroupData* group_data = LLGroupMgr::getInstance()->getGroupData(group_id);
+
+	if (group_data)
+	{
+		for (std::vector<LLUUID>::const_iterator i = selected_members.begin(); i != selected_members.end(); ++i)
+		{
+			LLSD args;
+			std::string name;
+			
+			gCacheName->getFullName(*i, name);
+
+			args["AVATAR_NAME"] = name;
+			args["GROUP_NAME"] = group_data->mName;
+			
+			LLNotifications::instance().add(LLNotification::Params("EjectAvatarFromGroup").substitutions(args));
+		}
+	}
+}
+
 void LLPanelGroupMembersSubTab::handleRoleCheck(const LLUUID& role_id,
 												LLRoleMemberChangeType type)
 {
diff --git a/indra/newview/llpanelgrouproles.h b/indra/newview/llpanelgrouproles.h
index b6e2245e70d..bb3c9096cf4 100644
--- a/indra/newview/llpanelgrouproles.h
+++ b/indra/newview/llpanelgrouproles.h
@@ -170,6 +170,7 @@ class LLPanelGroupMembersSubTab : public LLPanelGroupSubTab
 
 	static void onEjectMembers(void*);
 	void handleEjectMembers();
+	void sendEjectNotifications(const LLUUID& group_id, const std::vector<LLUUID>& selected_members);
 
 	static void onRoleCheck(LLUICtrl* check, void* user_data);
 	void handleRoleCheck(const LLUUID& role_id,
diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml
index 6e178ad5709..79ef1d104b9 100644
--- a/indra/newview/skins/default/xui/en/notifications.xml
+++ b/indra/newview/skins/default/xui/en/notifications.xml
@@ -1170,6 +1170,13 @@ Eject [AVATAR_NAME] from your land?
      yestext="Eject"/>
   </notification>
 
+  <notification
+   icon="alertmodal.tga"
+   name="EjectAvatarFromGroup"
+   type="notify">
+You ejected [AVATAR_NAME] from group [GROUP_NAME]
+  </notification>
+
   <notification
    icon="alertmodal.tga"
    name="AcquireErrorTooManyObjects"
-- 
GitLab