From 3a52b250e82aa04e5c72f5ae7f68f7b76db85921 Mon Sep 17 00:00:00 2001 From: Ansariel Date: Mon, 16 Feb 2015 12:45:16 +0100 Subject: [PATCH] Add "Show transcript" option to regular avatar SLURL context menu to keep it in sync with the specialized LLNameListCtrl version --- indra/llui/fsregistrarutils.h | 1 + indra/llui/llscrolllistctrl.cpp | 2 ++ indra/llui/lltextbase.cpp | 2 ++ indra/newview/fscommon.cpp | 5 +++++ indra/newview/fsslurlcommand.cpp | 10 ++++++++++ indra/newview/skins/default/xui/de/menu_url_agent.xml | 1 + indra/newview/skins/default/xui/en/menu_url_agent.xml | 9 +++++++++ 7 files changed, 30 insertions(+) diff --git a/indra/llui/fsregistrarutils.h b/indra/llui/fsregistrarutils.h index c6474ff24d..0b8d55f247 100644 --- a/indra/llui/fsregistrarutils.h +++ b/indra/llui/fsregistrarutils.h @@ -35,6 +35,7 @@ enum EFSRegistrarFunctionActionType FS_RGSTR_ACT_ADD_FRIEND, FS_RGSTR_ACT_REMOVE_FRIEND, FS_RGSTR_ACT_SEND_IM, + FS_RGSTR_ACT_VIEW_TRANSCRIPT, FS_RGSTR_ACT_ZOOM_IN, FS_RGSTR_ACT_OFFER_TELEPORT, FS_RGSTR_ACT_SHOW_PROFILE, diff --git a/indra/llui/llscrolllistctrl.cpp b/indra/llui/llscrolllistctrl.cpp index b2a4b1f9d9..c42777ca29 100755 --- a/indra/llui/llscrolllistctrl.cpp +++ b/indra/llui/llscrolllistctrl.cpp @@ -1968,6 +1968,7 @@ BOOL LLScrollListCtrl::handleRightMouseDown(S32 x, S32 y, MASK mask) registrar.add("FS.TrackAvatar", boost::bind(&LLUrlAction::executeSLURL, "secondlife:///app/firestorm/" + id + "/track")); registrar.add("FS.AddToContactSet", boost::bind(&LLUrlAction::executeSLURL, "secondlife:///app/firestorm/" + id + "/addtocontactset")); // [FS:CR] registrar.add("FS.BlockAvatar", boost::bind(&LLUrlAction::executeSLURL, "secondlife:///app/firestorm/" + id + "/blockavatar")); + registrar.add("FS.ViewLog", boost::bind(&LLUrlAction::executeSLURL, "secondlife:///app/firestorm/" + id + "/viewlog")); // Additional convenience options // Add enable checks for menu items @@ -1983,6 +1984,7 @@ BOOL LLScrollListCtrl::handleRightMouseDown(S32 x, S32 y, MASK mask) enable_registrar.add("FS.EnableRequestTeleport", boost::bind(&FSRegistrarUtils::checkIsEnabled, gFSRegistrarUtils, uuid, FS_RGSTR_ACT_REQUEST_TELEPORT)); enable_registrar.add("FS.CheckIsAgentBlocked", boost::bind(&FSRegistrarUtils::checkIsEnabled, gFSRegistrarUtils, uuid, FS_RGSTR_CHK_AVATAR_BLOCKED)); enable_registrar.add("FS.EnableBlockAvatar", boost::bind(&FSRegistrarUtils::checkIsEnabled, gFSRegistrarUtils, uuid, FS_RGSTR_CHK_IS_NOT_SELF)); + enable_registrar.add("FS.EnableViewLog", boost::bind(&FSRegistrarUtils::checkIsEnabled, gFSRegistrarUtils, uuid, FS_RGSTR_ACT_VIEW_TRANSCRIPT)); // // create the context menu from the XUI file and display it diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp index 7c27f63fd7..dbbe14f79d 100755 --- a/indra/llui/lltextbase.cpp +++ b/indra/llui/lltextbase.cpp @@ -2129,6 +2129,7 @@ void LLTextBase::createUrlContextMenu(S32 x, S32 y, const std::string &in_url) registrar.add("FS.TrackAvatar", boost::bind(&LLUrlAction::executeSLURL, "secondlife:///app/firestorm/" + target_id_str + "/track")); registrar.add("FS.AddToContactSet", boost::bind(&LLUrlAction::executeSLURL, "secondlife:///app/firestorm/" + target_id_str + "/addtocontactset")); // [FS:CR] registrar.add("FS.BlockAvatar", boost::bind(&LLUrlAction::executeSLURL, "secondlife:///app/firestorm/" + target_id_str + "/blockavatar")); + registrar.add("FS.ViewLog", boost::bind(&LLUrlAction::executeSLURL, "secondlife:///app/firestorm/" + target_id_str + "/viewlog")); // // Add enable checks for menu items @@ -2145,6 +2146,7 @@ void LLTextBase::createUrlContextMenu(S32 x, S32 y, const std::string &in_url) enable_registrar.add("FS.EnableRequestTeleport", boost::bind(&FSRegistrarUtils::checkIsEnabled, gFSRegistrarUtils, target_id, FS_RGSTR_ACT_REQUEST_TELEPORT)); enable_registrar.add("FS.CheckIsAgentBlocked", boost::bind(&FSRegistrarUtils::checkIsEnabled, gFSRegistrarUtils, target_id, FS_RGSTR_CHK_AVATAR_BLOCKED)); enable_registrar.add("FS.EnableBlockAvatar", boost::bind(&FSRegistrarUtils::checkIsEnabled, gFSRegistrarUtils, target_id, FS_RGSTR_CHK_IS_NOT_SELF)); + enable_registrar.add("FS.EnableViewLog", boost::bind(&FSRegistrarUtils::checkIsEnabled, gFSRegistrarUtils, target_id, FS_RGSTR_ACT_VIEW_TRANSCRIPT)); // // create and return the context menu from the XUI file diff --git a/indra/newview/fscommon.cpp b/indra/newview/fscommon.cpp index 373a47f047..fc1b8e93b6 100644 --- a/indra/newview/fscommon.cpp +++ b/indra/newview/fscommon.cpp @@ -34,6 +34,7 @@ #include "llavatarnamecache.h" #include "llfloaterperms.h" #include "llinventorymodel.h" +#include "lllogchat.h" #include "llmutelist.h" #include "llnotificationmanager.h" #include "llnotificationsutil.h" // reportToNearbyChat @@ -316,6 +317,10 @@ bool FSCommon::checkIsActionEnabled(const LLUUID& av_id, EFSRegistrarFunctionAct { return (!isSelf && RlvActions::canStartIM(av_id)); } + else if (action == FS_RGSTR_ACT_VIEW_TRANSCRIPT) + { + return (!isSelf && LLLogChat::isTranscriptExist(av_id)); + } else if (action == FS_RGSTR_ACT_ZOOM_IN) { return (!isSelf && LLAvatarActions::canZoomIn(av_id)); diff --git a/indra/newview/fsslurlcommand.cpp b/indra/newview/fsslurlcommand.cpp index 6e36f18cb6..ee9805c4cf 100644 --- a/indra/newview/fsslurlcommand.cpp +++ b/indra/newview/fsslurlcommand.cpp @@ -32,6 +32,7 @@ #include "llagent.h" #include "llavataractions.h" #include "llcommandhandler.h" +#include "lllogchat.h" #include "llnotificationsutil.h" @@ -126,6 +127,15 @@ public: return true; } + if (verb == "viewlog") + { + if (gAgentID != target_id && LLLogChat::isTranscriptExist(target_id)) + { + LLAvatarActions::viewChatHistory(target_id); + } + return true; + } + return false; } }; diff --git a/indra/newview/skins/default/xui/de/menu_url_agent.xml b/indra/newview/skins/default/xui/de/menu_url_agent.xml index d453d94019..801283ffc1 100755 --- a/indra/newview/skins/default/xui/de/menu_url_agent.xml +++ b/indra/newview/skins/default/xui/de/menu_url_agent.xml @@ -2,6 +2,7 @@ + diff --git a/indra/newview/skins/default/xui/en/menu_url_agent.xml b/indra/newview/skins/default/xui/en/menu_url_agent.xml index 751d50af4b..b1f61f2382 100755 --- a/indra/newview/skins/default/xui/en/menu_url_agent.xml +++ b/indra/newview/skins/default/xui/en/menu_url_agent.xml @@ -23,6 +23,15 @@ + + + +