From 372e5b6dfad34fa0927dcf0446136aee1e338a19 Mon Sep 17 00:00:00 2001
From: Andrey Kleshchev <andreykproductengine@lindenlab.com>
Date: Thu, 8 Sep 2022 02:18:25 +0300
Subject: [PATCH] SL-3007 Report abuse option in paticipan list

---
 indra/newview/llconversationloglist.cpp       |  3 ++-
 indra/newview/llconversationmodel.cpp         |  1 +
 indra/newview/llfloaterimcontainer.cpp        | 19 ++++++++++++++++++-
 .../default/xui/en/menu_conversation.xml      |  7 +++++++
 .../default/xui/en/menu_im_conversation.xml   |  7 +++++++
 5 files changed, 35 insertions(+), 2 deletions(-)

diff --git a/indra/newview/llconversationloglist.cpp b/indra/newview/llconversationloglist.cpp
index 86e23e7c83c..97b16a5e930 100644
--- a/indra/newview/llconversationloglist.cpp
+++ b/indra/newview/llconversationloglist.cpp
@@ -391,7 +391,8 @@ bool LLConversationLogList::isActionEnabled(const LLSD& userdata)
 			 "can_invite_to_group"	== command_name ||
 			 "can_share"			== command_name ||
 			 "can_block"			== command_name ||
-			 "can_pay"				== command_name)
+			 "can_pay"				== command_name ||
+			 "report_abuse"			== command_name)
 	{
 		return is_p2p;
 	}
diff --git a/indra/newview/llconversationmodel.cpp b/indra/newview/llconversationmodel.cpp
index a6856394275..9ec4fb085b2 100644
--- a/indra/newview/llconversationmodel.cpp
+++ b/indra/newview/llconversationmodel.cpp
@@ -182,6 +182,7 @@ void LLConversationItem::buildParticipantMenuOptions(menuentry_vec_t& items, U32
 		items.push_back(std::string("map"));
 		items.push_back(std::string("share"));
 		items.push_back(std::string("pay"));
+        items.push_back(std::string("report_abuse"));
 		items.push_back(std::string("block_unblock"));
 		items.push_back(std::string("MuteText"));
 
diff --git a/indra/newview/llfloaterimcontainer.cpp b/indra/newview/llfloaterimcontainer.cpp
index 1525bb9952f..703b5d0011b 100644
--- a/indra/newview/llfloaterimcontainer.cpp
+++ b/indra/newview/llfloaterimcontainer.cpp
@@ -45,6 +45,7 @@
 #include "llflashtimer.h"
 #include "llfloateravatarpicker.h"
 #include "llfloaterpreference.h"
+#include "llfloaterreporter.h"
 #include "llimview.h"
 #include "llnotificationsutil.h"
 #include "lltoolbarview.h"
@@ -1242,6 +1243,18 @@ void LLFloaterIMContainer::doToParticipants(const std::string& command, uuid_vec
 		{
 			LLAvatarActions::pay(userID);
 		}
+        else if ("report_abuse" == command)
+        {
+            LLAvatarName av_name;
+            if (LLAvatarNameCache::get(userID, &av_name))
+            {
+                LLFloaterReporter::showFromAvatar(userID, av_name.getCompleteName());
+            }
+            else
+            {
+                LLFloaterReporter::showFromAvatar(userID, "not avaliable");
+            }
+        }
 		else if ("block_unblock" == command)
 		{
 			LLAvatarActions::toggleMute(userID, LLMute::flagVoiceChat);
@@ -1507,7 +1520,11 @@ bool LLFloaterIMContainer::enableContextMenuItem(const std::string& item, uuid_v
 	}
 
 	// Handle all other options
-	if (("can_invite" == item) || ("can_chat_history" == item) || ("can_share" == item) || ("can_pay" == item))
+	if (("can_invite" == item)
+        || ("can_chat_history" == item)
+        || ("can_share" == item)
+        || ("can_pay" == item)
+        || ("report_abuse" == item))
 	{
 		// Those menu items are enable only if a single avatar is selected
 		return is_single_select;
diff --git a/indra/newview/skins/default/xui/en/menu_conversation.xml b/indra/newview/skins/default/xui/en/menu_conversation.xml
index ed362b36e54..59e6106a28a 100644
--- a/indra/newview/skins/default/xui/en/menu_conversation.xml
+++ b/indra/newview/skins/default/xui/en/menu_conversation.xml
@@ -132,6 +132,13 @@
         <on_click function="Avatar.DoToSelected" parameter="pay" />
         <on_enable function="Avatar.EnableItem" parameter="can_pay" />
     </menu_item_call>
+    <menu_item_call
+     label="Report Abuse"
+     layout="topleft"
+     name="report_abuse">
+       <on_click function="Avatar.DoToSelected" parameter="report_abuse" />
+       <on_enable function="Avatar.EnableItem" parameter="report_abuse" />
+    </menu_item_call>
     <menu_item_check
      label="Block Voice"
      layout="topleft"
diff --git a/indra/newview/skins/default/xui/en/menu_im_conversation.xml b/indra/newview/skins/default/xui/en/menu_im_conversation.xml
index 43287c6ec36..b38fae44041 100644
--- a/indra/newview/skins/default/xui/en/menu_im_conversation.xml
+++ b/indra/newview/skins/default/xui/en/menu_im_conversation.xml
@@ -79,6 +79,13 @@
     </menu_item_call>
     <menu_item_separator
      layout="topleft"/>
+    <menu_item_call
+     label="Report Abuse"
+     layout="topleft"
+     name="Report Abuse">
+       <on_click function="Avatar.GearDoToSelected" parameter="report_abuse" />
+       <on_enable function="Avatar.EnableGearItem" parameter="report_abuse" />
+    </menu_item_call>
     <menu_item_check
      label="Block Voice"
      layout="topleft"
-- 
GitLab