From 36347aba83115ebe9bf55d5bc27f67ad53da7a70 Mon Sep 17 00:00:00 2001 From: Inusaito Sayori Date: Fri, 22 May 2015 11:38:17 -0400 Subject: [PATCH] [RLVa] Censor Report Abuse floater This shouldn't matter because it only censors the ui elements, everything else the floater sends is untouched, ids and actual name variables... It annoyed me that pie menu could work around @shownames and @shownametags restrictions. --- indra/newview/llfloaterreporter.cpp | 27 ++++++++++++++----- .../skins/default/xui/en-us/menu_viewer.xml | 4 --- 2 files changed, 21 insertions(+), 10 deletions(-) diff --git a/indra/newview/llfloaterreporter.cpp b/indra/newview/llfloaterreporter.cpp index 08cef05d7..301f8491e 100644 --- a/indra/newview/llfloaterreporter.cpp +++ b/indra/newview/llfloaterreporter.cpp @@ -83,6 +83,8 @@ #include "lltrans.h" +#include "rlvhandler.h" + const U32 INCLUDE_SCREENSHOT = 0x01 << 0; //----------------------------------------------------------------------------- @@ -300,7 +302,10 @@ void LLFloaterReporter::callbackAvatarID(const uuid_vec_t& ids, const std::vecto { if (ids.empty() || names.empty()) return; - getChild("abuser_name_edit")->setValue(names[0].getCompleteName()); + if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES) || gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMETAGS)) + getChild("abuser_name_edit")->setValue(RlvStrings::getString(RLV_STRING_HIDDEN)); + else + getChild("abuser_name_edit")->setValue(names[0].getCompleteName()); mAbuserID = ids[0]; @@ -326,9 +331,10 @@ void LLFloaterReporter::onAvatarNameCache(const LLUUID& avatar_id, const LLAvata if (mObjectID == avatar_id) { mOwnerName = av_name.getNSName(); - getChild("owner_name")->setValue(av_name.getNSName()); - getChild("object_name")->setValue(av_name.getNSName()); - getChild("abuser_name_edit")->setValue(av_name.getNSName()); + const std::string& name(((gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES) || gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMETAGS)) && RlvUtil::isNearbyAgent(avatar_id)) ? RlvStrings::getString(RLV_STRING_HIDDEN) : mOwnerName); + getChild("owner_name")->setValue(name); + getChild("object_name")->setValue(name); + getChild("abuser_name_edit")->setValue(name); } } @@ -506,8 +512,17 @@ void LLFloaterReporter::setPickedObjectProperties(const std::string& object_name getChild("object_name")->setValue(object_name); - getChild("owner_name")->setValue(owner_name); - getChild("abuser_name_edit")->setValue(owner_name); + if ((gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES) || gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMETAGS)) && RlvUtil::isNearbyAgent(owner_id)) + { + const std::string& rlv_hidden(RlvStrings::getString(RLV_STRING_HIDDEN)); + getChild("owner_name")->setValue(rlv_hidden); + getChild("abuser_name_edit")->setValue(rlv_hidden); + } + else + { + getChild("owner_name")->setValue(owner_name); + getChild("abuser_name_edit")->setValue(owner_name); + } mAbuserID = owner_id; mOwnerName = owner_name; } diff --git a/indra/newview/skins/default/xui/en-us/menu_viewer.xml b/indra/newview/skins/default/xui/en-us/menu_viewer.xml index 9ab1140e2..c41b11c07 100644 --- a/indra/newview/skins/default/xui/en-us/menu_viewer.xml +++ b/indra/newview/skins/default/xui/en-us/menu_viewer.xml @@ -1075,10 +1075,6 @@ - - - -