diff --git a/indra/newview/llimprocessing.cpp b/indra/newview/llimprocessing.cpp index 3cbdb2e9921872d4db21524e1db2529982624352..34eaafc0b8ae92fb85bc3d81136d7308d3286c0e 100644 --- a/indra/newview/llimprocessing.cpp +++ b/indra/newview/llimprocessing.cpp @@ -1334,10 +1334,11 @@ void LLIMProcessing::processNewMessage(LLUUID from_id, // [RLVa:KB] - Checked: RLVa-1.4.9 if (rlv_handler_t::isEnabled()) { - if ( ((IM_LURE_USER == dialog) && (!RlvActions::canAcceptTpOffer(from_id))) || - ((IM_TELEPORT_REQUEST == dialog) && (!RlvActions::canAcceptTpRequest(from_id))) ) + bool fBlockTpLure = (IM_LURE_USER == dialog) && (!RlvActions::canAcceptTpOffer(from_id)); + bool fBlockTpRequest = (IM_TELEPORT_REQUEST == dialog) && (!RlvActions::canAcceptTpRequest(from_id)); + if ( fBlockTpLure || fBlockTpRequest ) { - RlvUtil::sendBusyMessage(from_id, RlvStrings::getString(RlvStringKeys::Blocked::TpLureRequestRemote)); + RlvUtil::sendBusyMessage(from_id, RlvStrings::getString(fBlockTpLure ? RlvStringKeys::Blocked::TpLureRemote : RlvStringKeys::Blocked::TpRequestRemote)); if (is_do_not_disturb) send_do_not_disturb_message(gMessageSystem, from_id); return; diff --git a/indra/newview/rlvcommon.cpp b/indra/newview/rlvcommon.cpp index 0c9304962391f641efb3132df72cf50ab9240ac3..581002e631e05267ffa7a87a8c7700d63e59721b 100644 --- a/indra/newview/rlvcommon.cpp +++ b/indra/newview/rlvcommon.cpp @@ -279,6 +279,23 @@ void RlvStrings::initClass() } } +// Used to provide fallback behaviour whenever we rename/split/join customizable string values +LLSD& RlvStrings::cleanStringValues(LLSD& sdStringValues) +{ + LLSD sdValues(sdStringValues); + for (LLSD::map_const_iterator itString = sdValues.beginMap(); itString != sdValues.endMap(); ++itString) + { + if (itString->first == "blocked_tplurerequest_remote") + { + sdStringValues.erase("blocked_tplurerequest_remote"); + sdStringValues[RlvStringKeys::Blocked::TpLureRemote] = itString->second; + sdStringValues[RlvStringKeys::Blocked::TpRequestRemote] = itString->second; + } + } + + return sdStringValues; +} + // Checked: 2011-11-08 (RLVa-1.5.0) void RlvStrings::loadFromFile(const std::string& strFilePath, bool fUserOverride) { @@ -289,7 +306,7 @@ void RlvStrings::loadFromFile(const std::string& strFilePath, bool fUserOverride if (sdFileData.has("strings")) { - const LLSD& sdStrings = sdFileData["strings"]; + const LLSD sdStrings = (!fUserOverride) ? sdFileData["strings"] : cleanStringValues(sdFileData["strings"]); for (LLSD::map_const_iterator itString = sdStrings.beginMap(); itString != sdStrings.endMap(); ++itString) { if ( (!itString->second.has("value")) || ((fUserOverride) && (!hasString(itString->first))) ) diff --git a/indra/newview/rlvcommon.h b/indra/newview/rlvcommon.h index 008e4d6fa4553076f3383a914c13b07a8b5db450..666d036e4de96fd82e7acce9539a58ae3a74e2eb 100644 --- a/indra/newview/rlvcommon.h +++ b/indra/newview/rlvcommon.h @@ -148,6 +148,7 @@ class RlvStrings { public: static void initClass(); + static LLSD& cleanStringValues(LLSD& sdValues); static void loadFromFile(const std::string& strFilePath, bool fDefault); static void saveToFile(const std::string& strFilePath); diff --git a/indra/newview/rlvdefines.h b/indra/newview/rlvdefines.h index dff03ef5361a6b7cb3b8993c7de3bb9aacbd9b69..c199f379393bbdaf02c06bfcda10628c61f93245 100644 --- a/indra/newview/rlvdefines.h +++ b/indra/newview/rlvdefines.h @@ -469,28 +469,30 @@ namespace RlvStringKeys /*inline*/ constexpr boost::string_view StartIm = make_string_view("blocked_startim"); /*inline*/ constexpr boost::string_view Teleport = make_string_view("blocked_teleport"); /*inline*/ constexpr boost::string_view TeleportOffer = make_string_view("blocked_teleport_offer"); - /*inline*/ constexpr boost::string_view TpLureRequestRemote = make_string_view("blocked_tplurerequest_remote"); + /*inline*/ constexpr boost::string_view TpLureRemote = make_string_view("blocked_tplure_remote"); + /*inline*/ constexpr boost::string_view TpRequestRemote = make_string_view("blocked_tprequest_remote"); /*inline*/ constexpr boost::string_view ViewXxx = make_string_view("blocked_viewxxx"); /*inline*/ constexpr boost::string_view Wireframe = make_string_view("blocked_wireframe"); #else - constexpr const char AutoPilot[] = "blocked_autopilot"; - constexpr const char Generic[] = "blocked_generic"; - constexpr const char GroupChange[] = "blocked_groupchange"; - constexpr const char InvFolder[] = "blocked_invfolder"; - constexpr const char PermissionAttach[] = "blocked_permattach"; - constexpr const char PermissionTeleport[] = "blocked_permteleport"; - constexpr const char RecvIm[] = "blocked_recvim"; - constexpr const char RecvImRemote[] = "blocked_recvim_remote"; - constexpr const char SendIm[] = "blocked_sendim"; - constexpr const char Share[] = "blocked_share"; - constexpr const char ShareGeneric[] = "blocked_share_generic"; - constexpr const char StartConference[] = "blocked_startconf"; - constexpr const char StartIm[] = "blocked_startim"; - constexpr const char Teleport[] = "blocked_teleport"; - constexpr const char TeleportOffer[] = "blocked_teleport_offer"; - constexpr const char TpLureRequestRemote[] = "blocked_tplurerequest_remote"; - constexpr const char ViewXxx[] = "blocked_viewxxx"; - constexpr const char Wireframe[] = "blocked_wireframe"; + static constexpr const char AutoPilot[] = "blocked_autopilot"; + static constexpr const char Generic[] = "blocked_generic"; + static constexpr const char GroupChange[] = "blocked_groupchange"; + static constexpr const char InvFolder[] = "blocked_invfolder"; + static constexpr const char PermissionAttach[] = "blocked_permattach"; + static constexpr const char PermissionTeleport[] = "blocked_permteleport"; + static constexpr const char RecvIm[] = "blocked_recvim"; + static constexpr const char RecvImRemote[] = "blocked_recvim_remote"; + static constexpr const char SendIm[] = "blocked_sendim"; + static constexpr const char Share[] = "blocked_share"; + static constexpr const char ShareGeneric[] = "blocked_share_generic"; + static constexpr const char StartConference[] = "blocked_startconf"; + static constexpr const char StartIm[] = "blocked_startim"; + static constexpr const char Teleport[] = "blocked_teleport"; + static constexpr const char TeleportOffer[] = "blocked_teleport_offer"; + static constexpr const char TpLureRemote[] = "blocked_tplure_remote"; + static constexpr const char TpRequestRemote[] = "blocked_tprequest_remote"; + static constexpr const char ViewXxx[] = "blocked_viewxxx"; + static constexpr const char Wireframe[] = "blocked_wireframe"; #endif // CATZNIP_STRINGVIEW } diff --git a/indra/newview/skins/default/xui/en/rlva_strings.xml b/indra/newview/skins/default/xui/en/rlva_strings.xml index 3ffb3d90094faa6b79b16e959a6ecb84b45d39a9..95321f7ac68ba2b992279cda923d5bc8cbf01052 100644 --- a/indra/newview/skins/default/xui/en/rlva_strings.xml +++ b/indra/newview/skins/default/xui/en/rlva_strings.xml @@ -194,14 +194,25 @@ <key>customizable</key> <boolean>1</boolean> </map> - <key>blocked_tplurerequest_remote</key> + <key>blocked_tplure_remote</key> <map> <key>value</key> <string>The Resident is currently prevented from accepting. Please try again later.</string> <key>description</key> - <string>Sent to the remote party when their teleport offer or request was blocked</string> + <string>Sent to the remote party when their teleport offer was blocked</string> <key>label</key> - <string>Blocked teleport offer/request (remote)</string> + <string>Blocked teleport offer (remote)</string> + <key>customizable</key> + <boolean>1</boolean> + </map> + <key>blocked_tprequest_remote</key> + <map> + <key>value</key> + <string>The Resident is currently prevented from accepting. Please try again later.</string> + <key>description</key> + <string>Sent to the remote party when their teleport request was blocked</string> + <key>label</key> + <string>Blocked teleport request (remote)</string> <key>customizable</key> <boolean>1</boolean> </map>