diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp index d9c5e9153..35f731bff 100644 --- a/indra/newview/llavataractions.cpp +++ b/indra/newview/llavataractions.cpp @@ -506,8 +506,12 @@ void LLAvatarActions::on_avatar_name_cache_teleport_request(const LLUUID& id, co { LLSD notification; notification["uuid"] = id; - //notification["NAME_SLURL"] = LLSLURL("agent", id, "about").getSLURLString(); std::string name; +// [RLVa:KB] - Checked: 2014-03-31 (Catznip-3.6) + if (!RlvActions::canShowName(RlvActions::SNC_TELEPORTREQUEST)) + name = RlvStrings::getAnonym(av_name.getLegacyName()); + else +// [RLVa:KB] LLAvatarNameCache::getPNSName(av_name, name); notification["NAME"] = name; LLSD payload; diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index dbd630fb9..4c5e6fad2 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -2523,7 +2523,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) { if (!mute_im) RlvUtil::sendBusyMessage(from_id, RlvStrings::getString(RLV_STRING_BLOCKED_RECVIM_REMOTE), session_id); - message = RlvStrings::getString(RLV_STRING_BLOCKED_RECVIM); + buffer = RlvStrings::getString(RLV_STRING_BLOCKED_RECVIM); } // [/RLVa:KB] @@ -4053,10 +4053,8 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data) sdQuery["name"] = chat.mFromName; sdQuery["owner"] = owner_id; - /* Singu Note: We don't use this field, seems like part of llinspectremoteobject if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (!is_owned_by_me) ) sdQuery["rlv_shownames"] = true; - */ const LLViewerRegion* pRegion = LLWorld::getInstance()->getRegionFromPosAgent(chat.mPosAgent); if (pRegion) @@ -7751,6 +7749,39 @@ void send_lures(const LLSD& notification, const LLSD& response) msg->nextBlockFast(_PREHASH_TargetData); msg->addUUIDFast(_PREHASH_TargetID, target_id); + // Record the offer. + if (notification["payload"]["ids"].size() < 10) // Singu Note: Do NOT spam chat! + { +// [RLVa:KB] - Checked: 2014-03-31 (Catznip-3.6) + bool fRlvHideName = notification["payload"]["rlv_shownames"].asBoolean(); +// [/RLVa:KB] + std::string target_name; + gCacheName->getFullName(target_id, target_name); // for im log filenames + + LLSD args; +// [RLVa:KB] - Checked: 2014-03-31 (Catznip-3.6) + if (fRlvHideName) + target_name = RlvStrings::getAnonym(target_name); + else +// [/RLVa:KB] + LLAvatarNameCache::getPNSName(target_id, target_name); + args["TO_NAME"] = target_name; + + LLSD payload; + + //*TODO please rewrite all keys to the same case, lower or upper + payload["from_id"] = target_id; + payload["SUPPRESS_TOAST"] = true; + LLNotificationsUtil::add("TeleportOfferSent", args, payload); + + /* Singu TODO? +// [RLVa:KB] - Checked: 2014-03-31 (Catznip-3.6) + if (!fRlvHideName) + LLRecentPeople::instance().add(target_id); +// [/RLVa:KB] +// LLRecentPeople::instance().add(target_id); + */ + } } gAgent.sendReliableMessage(); } @@ -7795,8 +7826,7 @@ void handle_lure(const uuid_vec_t& ids) LLSD edit_args; // [RLVa:KB] - Checked: 2010-04-07 (RLVa-1.2.0d) | Modified: RLVa-1.0.0a - edit_args["REGION"] = - (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) ? gAgent.getRegion()->getName() : RlvStrings::getString(RLV_STRING_HIDDEN); + edit_args["REGION"] = (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) ? gAgent.getRegion()->getName() : RlvStrings::getString(RLV_STRING_HIDDEN); // [/RLVa:KB] //edit_args["REGION"] = gAgent.getRegion()->getName(); @@ -7816,6 +7846,7 @@ void handle_lure(const uuid_vec_t& ids) return; } } + payload["rlv_shownames"] = !RlvActions::canShowName(RlvActions::SNC_TELEPORTOFFER); // [/RLVa:KB] payload["ids"].append(*it); } diff --git a/indra/newview/rlvactions.cpp b/indra/newview/rlvactions.cpp index 2ea2646cb..b746cda4a 100644 --- a/indra/newview/rlvactions.cpp +++ b/indra/newview/rlvactions.cpp @@ -21,9 +21,11 @@ #include "rlvhandler.h" // ============================================================================ -// RlvActions member functions +// Communication/Avatar interaction // +bool RlvActions::s_BlockNamesContexts[SNC_COUNT] = { 0 }; + // Checked: 2010-11-30 (RLVa-1.3.0) bool RlvActions::canReceiveIM(const LLUUID& idSender) { @@ -60,6 +62,10 @@ bool RlvActions::canStartIM(const LLUUID& idRecipient) ( (!gRlvHandler.hasBehaviour(RLV_BHVR_STARTIMTO)) || (!gRlvHandler.isException(RLV_BHVR_STARTIMTO, idRecipient)) ) ); } +// ============================================================================ +// Movement +// + // Checked: 2010-12-11 (RLVa-1.2.2) bool RlvActions::canAcceptTpOffer(const LLUUID& idSender) { @@ -84,6 +90,10 @@ bool RlvActions::autoAcceptTeleportRequest(const LLUUID& idRequester) return ((idRequester.notNull()) && (gRlvHandler.isException(RLV_BHVR_ACCEPTTPREQUEST, idRequester))) || (gRlvHandler.hasBehaviour(RLV_BHVR_ACCEPTTPREQUEST)); } +// ============================================================================ +// World interaction +// + // Checked: 2010-03-07 (RLVa-1.2.0) bool RlvActions::canStand() { @@ -97,6 +107,10 @@ bool RlvActions::canShowLocation() return !gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC); } +// ============================================================================ +// Helper functions +// + // Checked: 2013-05-10 (RLVa-1.4.9) bool RlvActions::hasBehaviour(ERlvBehaviour eBhvr) { diff --git a/indra/newview/rlvactions.h b/indra/newview/rlvactions.h index 58d90780a..fbc8ab12b 100644 --- a/indra/newview/rlvactions.h +++ b/indra/newview/rlvactions.h @@ -25,9 +25,9 @@ class RlvActions { - // ============= - // Communication - // ============= + // ================================ + // Communication/Avatar interaction + // ================================ public: /* * Returns true if the user is allowed to receive IMs from the specified sender (can be an avatar or a group) @@ -44,6 +44,19 @@ public: */ static bool canStartIM(const LLUUID& idRecipient); // @startim and @startimto + /* + * Returns true if an avatar's name should be hidden for the requested operation/context + * (This is used to hide an avatar name in one case but not a near-identical case - such as teleporting a friend vs a nearby agent - + * in a way that limits the amount of code that needs to be changed to carry context from one function to another) + */ + enum EShowNamesContext { SNC_TELEPORTOFFER = 0, SNC_TELEPORTREQUEST, SNC_COUNT }; + static bool canShowName(EShowNamesContext eContext) { return (eContext < SNC_COUNT) ? !s_BlockNamesContexts[eContext] : false; } + static void setShowName(EShowNamesContext eContext, bool fShowName) { if ( (eContext < SNC_COUNT) && (isRlvEnabled()) ) { s_BlockNamesContexts[eContext] = !fShowName; } } + +protected: + // Backwards logic so that we can initialize to 0 and it won't block when we forget to/don't check if RLVa is disabled + static bool s_BlockNamesContexts[SNC_COUNT]; + // ======== // Movement // ======== diff --git a/indra/newview/rlvui.cpp b/indra/newview/rlvui.cpp index aa1f83153..46327d8c2 100644 --- a/indra/newview/rlvui.cpp +++ b/indra/newview/rlvui.cpp @@ -261,8 +261,12 @@ void RlvUIEnabler::onToggleShowLoc() { bool fEnable = !gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC); - // RELEASE-RLVa: [SL-2.0.1] Check that the code below still evaluates to *only* LLNavigationBar::instance().mCmbLocation->refresh() - //LLAppViewer::instance()->handleLoginComplete(); + /* Singu TODO: LLNavigationBar + if (LLNavigationBar::instanceExists()) + LLNavigationBar::instance().refreshLocationCtrl(); + if (LLPanelTopInfoBar::instanceExists()) + LLPanelTopInfoBar::instance().update(); + */ if (!fEnable) { 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 59bf7cdd3..ae5277ba4 100644 --- a/indra/newview/skins/default/xui/en-us/menu_viewer.xml +++ b/indra/newview/skins/default/xui/en-us/menu_viewer.xml @@ -617,22 +617,27 @@ + + + + + diff --git a/indra/newview/skins/default/xui/en-us/notifications.xml b/indra/newview/skins/default/xui/en-us/notifications.xml index 5194b4c6b..f015201e7 100644 --- a/indra/newview/skins/default/xui/en-us/notifications.xml +++ b/indra/newview/skins/default/xui/en-us/notifications.xml @@ -6796,6 +6796,16 @@ An object named [OBJECTFROMNAME] owned by (an unknown user) has given you a [OBJ + + Teleport offer sent to [TO_NAME] + +