diff --git a/indra/newview/llattachmentsmgr.cpp b/indra/newview/llattachmentsmgr.cpp index 1c575dbd9f912a72a32d9948f308b25b9cc71419..73c3958b135b800249c067d168d267d0686a9ee8 100644 --- a/indra/newview/llattachmentsmgr.cpp +++ b/indra/newview/llattachmentsmgr.cpp @@ -36,7 +36,7 @@ #include "llviewerregion.h" #include "message.h" // [RLVa:KB] - Checked: 2011-05-22 (RLVa-1.3.1a) -#include "rlvhandler.h" +#include "rlvactions.h" #include "rlvlocks.h" // [/RLVa:KB] @@ -104,7 +104,7 @@ void LLAttachmentsMgr::addAttachmentRequest(const LLUUID& item_id, attachment.mAdd = add; // [RLVa:KB] - Checked: 2010-09-23 (RLVa-1.2.1) - if ( (rlv_handler_t::isEnabled()) && (!fRlvForce) && (gRlvAttachmentLocks.hasLockedAttachmentPoint(RLV_LOCK_ANY)) && (gAgentWearables.areInitialAttachmentsRequested()) ) + if ( (RlvActions::isRlvEnabled()) && (!fRlvForce) && (gRlvAttachmentLocks.hasLockedAttachmentPoint(RLV_LOCK_ANY)) && (gAgentWearables.areInitialAttachmentsRequested()) ) { const LLInventoryItem* pItem = gInventory.getItem(item_id); if (!pItem) diff --git a/indra/newview/llchatbar.cpp b/indra/newview/llchatbar.cpp index 90f5fee4d9c394e4637703a9f35d7bba9db2a407..41b65869d661332ede86775cb33734b037eade89 100644 --- a/indra/newview/llchatbar.cpp +++ b/indra/newview/llchatbar.cpp @@ -60,7 +60,8 @@ #include "llviewermenu.h" #include "lluictrlfactory.h" // [RLVa:KB] - Checked: 2010-02-27 (RLVa-1.2.0b) -#include "rlvhandler.h" +#include "rlvactions.h" +#include "rlvcommon.h" // [/RLVa:KB] // @@ -480,7 +481,7 @@ void LLChatBar::onInputEditorKeystroke( LLLineEditor* caller, void* userdata ) // if( (length > 0) && (raw_text[0] != '/') ) // forward slash is used for escape (eg. emote) sequences // [RLVa:KB] - Checked: 2010-03-26 (RLVa-1.2.0b) | Modified: RLVa-1.0.0d // RELEASE-RLVa: [SL-2.0.0] This entire class appears to be dead/non-functional? - if ( (length > 0) && (raw_text[0] != '/') && (!gRlvHandler.hasBehaviour(RLV_BHVR_REDIRCHAT)) ) + if ( (length > 0) && (raw_text[0] != '/') && (!RlvActions::hasBehaviour(RLV_BHVR_REDIRCHAT)) ) // [/RLVa:KB] { gAgent.startTyping(); @@ -595,17 +596,11 @@ void LLChatBar::sendChatFromViewer(const LLWString &wtext, EChatType type, BOOL // [RLVa:KB] - Checked: 2010-03-27 (RLVa-1.2.0b) | Modified: RLVa-1.2.0b // RELEASE-RLVa: [SL-2.0.0] This entire class appears to be dead/non-functional? - if ( (0 == channel) && (rlv_handler_t::isEnabled()) ) + if ( (0 == channel) && (RlvActions::isRlvEnabled()) ) { // Adjust the (public) chat "volume" on chat and gestures (also takes care of playing the proper animation) - if ( ((CHAT_TYPE_SHOUT == type) || (CHAT_TYPE_NORMAL == type)) && (gRlvHandler.hasBehaviour(RLV_BHVR_CHATNORMAL)) ) - type = CHAT_TYPE_WHISPER; - else if ( (CHAT_TYPE_SHOUT == type) && (gRlvHandler.hasBehaviour(RLV_BHVR_CHATSHOUT)) ) - type = CHAT_TYPE_NORMAL; - else if ( (CHAT_TYPE_WHISPER == type) && (gRlvHandler.hasBehaviour(RLV_BHVR_CHATWHISPER)) ) - type = CHAT_TYPE_NORMAL; - - animate &= !gRlvHandler.hasBehaviour( (!RlvUtil::isEmote(utf8_text)) ? RLV_BHVR_REDIRCHAT : RLV_BHVR_REDIREMOTE ); + type = RlvActions::checkChatVolume(type); + animate &= !RlvActions::hasBehaviour( (!RlvUtil::isEmote(utf8_text)) ? RLV_BHVR_REDIRCHAT : RLV_BHVR_REDIREMOTE ); } // [/RLVa:KB] diff --git a/indra/newview/llfloaterimnearbychat.cpp b/indra/newview/llfloaterimnearbychat.cpp index 5f9ecbd30c156927d6b43fa0e5101b71b42698bf..34dd9f9bf8cc783881b1554d91205a41b384acc1 100644 --- a/indra/newview/llfloaterimnearbychat.cpp +++ b/indra/newview/llfloaterimnearbychat.cpp @@ -68,8 +68,9 @@ #include "lltranslate.h" #include "llautoreplace.h" // [RLVa:KB] - Checked: 2010-02-27 (RLVa-1.2.0b) -#include "rlvhandler.h" #include "rlvactions.h" +#include "rlvcommon.h" +#include "rlvhandler.h" // [/RLVa:KB] S32 LLFloaterIMNearbyChat::sLastSpecialChatChannel = 0; @@ -849,17 +850,12 @@ void send_chat_from_viewer(std::string utf8_out_text, EChatType type, S32 channe { // [RLVa:KB] - Checked: 2010-02-27 (RLVa-1.2.0b) | Modified: RLVa-1.2.0a // Only process chat messages (ie not CHAT_TYPE_START, CHAT_TYPE_STOP, etc) - if ( (rlv_handler_t::isEnabled()) && ( (CHAT_TYPE_WHISPER == type) || (CHAT_TYPE_NORMAL == type) || (CHAT_TYPE_SHOUT == type) ) ) + if ( (RlvActions::isRlvEnabled()) && ( (CHAT_TYPE_WHISPER == type) || (CHAT_TYPE_NORMAL == type) || (CHAT_TYPE_SHOUT == type) ) ) { if (0 == channel) { - // (We already did this before, but LLChatHandler::handle() calls this directly) - if ( ((CHAT_TYPE_SHOUT == type) || (CHAT_TYPE_NORMAL == type)) && (gRlvHandler.hasBehaviour(RLV_BHVR_CHATNORMAL)) ) - type = CHAT_TYPE_WHISPER; - else if ( (CHAT_TYPE_SHOUT == type) && (gRlvHandler.hasBehaviour(RLV_BHVR_CHATSHOUT)) ) - type = CHAT_TYPE_NORMAL; - else if ( (CHAT_TYPE_WHISPER == type) && (gRlvHandler.hasBehaviour(RLV_BHVR_CHATWHISPER)) ) - type = CHAT_TYPE_NORMAL; + // Clamp the volume of the chat if needed + type = RlvActions::checkChatVolume(type); // Redirect chat if needed if ( ( (gRlvHandler.hasBehaviour(RLV_BHVR_REDIRCHAT) || (gRlvHandler.hasBehaviour(RLV_BHVR_REDIREMOTE)) ) && diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp index d11a7ea98741e1b459a2b015bfa55edb5ffef8f5..70e5b7dcc82b8ceb4a89c5aca64c022b0d91c9fd 100644 --- a/indra/newview/llinventoryfunctions.cpp +++ b/indra/newview/llinventoryfunctions.cpp @@ -87,7 +87,7 @@ #include "llvoavatarself.h" #include "llwearablelist.h" // [RLVa:KB] - Checked: 2011-05-22 (RLVa-1.3.1a) -#include "rlvhandler.h" +#include "rlvactions.h" #include "rlvlocks.h" // [/RLVa:KB] @@ -633,7 +633,7 @@ BOOL get_is_item_removable(const LLInventoryModel* model, const LLUUID& id) } // [RLVa:KB] - Checked: 2011-03-29 (RLVa-1.3.0g) | Modified: RLVa-1.3.0g - if ( (rlv_handler_t::isEnabled()) && + if ( (RlvActions::isRlvEnabled()) && (RlvFolderLocks::instance().hasLockedFolder(RLV_LOCK_ANY)) && (!RlvFolderLocks::instance().canRemoveItem(id)) ) { return FALSE; @@ -669,7 +669,7 @@ BOOL get_is_category_removable(const LLInventoryModel* model, const LLUUID& id) } // [RLVa:KB] - Checked: 2011-03-29 (RLVa-1.3.0g) | Modified: RLVa-1.3.0g - if ( ((rlv_handler_t::isEnabled()) && + if ( ((RlvActions::isRlvEnabled()) && (RlvFolderLocks::instance().hasLockedFolder(RLV_LOCK_ANY)) && (!RlvFolderLocks::instance().canRemoveFolder(id))) ) { return FALSE; @@ -712,7 +712,7 @@ BOOL get_is_category_renameable(const LLInventoryModel* model, const LLUUID& id) } // [RLVa:KB] - Checked: 2011-03-29 (RLVa-1.3.0g) | Modified: RLVa-1.3.0g - if ( (rlv_handler_t::isEnabled()) && (model == &gInventory) && (!RlvFolderLocks::instance().canRenameFolder(id)) ) + if ( (RlvActions::isRlvEnabled()) && (model == &gInventory) && (!RlvFolderLocks::instance().canRenameFolder(id)) ) { return FALSE; } diff --git a/indra/newview/llteleporthistorystorage.cpp b/indra/newview/llteleporthistorystorage.cpp index 593960fa6cc3a98e4a51156e9b3cea068ed9b2c7..3025ea57c6a56e57cd10719e01528ed3434aa613 100644 --- a/indra/newview/llteleporthistorystorage.cpp +++ b/indra/newview/llteleporthistorystorage.cpp @@ -34,7 +34,7 @@ #include "llteleporthistory.h" #include "llagent.h" // [RLVa:KB] - Checked: 2010-09-03 (RLVa-1.2.1b) -#include "rlvhandler.h" +#include "rlvactions.h" // [/RLVa:KB] // Max offset for two global positions to consider them as equal @@ -127,7 +127,7 @@ bool LLTeleportHistoryStorage::compareByTitleAndGlobalPos(const LLTeleportHistor void LLTeleportHistoryStorage::addItem(const std::string title, const LLVector3d& global_pos, const LLDate& date) { // [RLVa:KB] - Checked: 2010-09-03 (RLVa-1.2.1b) | Added: RLVa-1.2.1b - if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) + if (!RlvActions::canShowLocation()) { return; } diff --git a/indra/newview/lltracker.cpp b/indra/newview/lltracker.cpp index 5ff2771922806af651491b47b189c4377d6ed440..a32b033dba7b29a6fbc40df1b59a0a907269bcf7 100644 --- a/indra/newview/lltracker.cpp +++ b/indra/newview/lltracker.cpp @@ -62,9 +62,6 @@ #include "llworldmapview.h" #include "llviewercontrol.h" -// [RLVa:KB] -#include "rlvhandler.h" -// [/RLVa:KB] const F32 DESTINATION_REACHED_RADIUS = 3.0f; const F32 DESTINATION_VISITED_RADIUS = 6.0f; diff --git a/indra/newview/llviewercamera.cpp b/indra/newview/llviewercamera.cpp index 4b0a36ddcd788dfffd63cd90ff2af304e808ecb8..d3facd7e31daecf31409ceee12274d5e4d5c2406 100644 --- a/indra/newview/llviewercamera.cpp +++ b/indra/newview/llviewercamera.cpp @@ -43,7 +43,6 @@ #include "llviewerjoystick.h" // [RLVa:KB] - RLVa-2.0.0 #include "rlvactions.h" -#include "rlvhandler.h" // [/RLVa:KB] // Linden library includes diff --git a/indra/newview/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp index f631ecc9c2b11e8d8bbf107f1a0a4f749f2d91ca..b43c32bc5011ce7316fc3726474665c61c823781 100644 --- a/indra/newview/llviewerdisplay.cpp +++ b/indra/newview/llviewerdisplay.cpp @@ -79,7 +79,6 @@ #include "llpostprocess.h" #include "llscenemonitor.h" // [RLVa:KB] - Checked: 2011-05-22 (RLVa-1.3.1a) -#include "rlvhandler.h" #include "rlvlocks.h" // [/RLVa:KB] diff --git a/indra/newview/llviewerkeyboard.cpp b/indra/newview/llviewerkeyboard.cpp index d84c1c93c8790f747acba3aaedc0a7a0def9217e..3dd0c8e0db1d6895183acdb2b9f6ec7d29b2c9b6 100644 --- a/indra/newview/llviewerkeyboard.cpp +++ b/indra/newview/llviewerkeyboard.cpp @@ -42,9 +42,6 @@ #include "llvoavatarself.h" #include "llfloatercamera.h" #include "llinitparam.h" -// [RLVa:KB] - Checked: 2011-05-11 (RLVa-1.3.0i) | Added: RLVa-1.3.0i -#include "rlvhandler.h" -// [/RLVa:KB] // // Constants diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 28b04936d9b18cca86ca81f850b90504b97eba61..8594244b3dd4fd9d3abb7d61c64fc0b4ce953830 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -3720,7 +3720,7 @@ class LLSelfStandUp : public view_listener_t bool enable_standup_self() { // [RLVa:KB] - Checked: 2010-04-01 (RLVa-1.2.0c) | Modified: RLVa-1.0.0g - return isAgentAvatarValid() && gAgentAvatarp->isSitting() && !RlvActions::canStand(); + return isAgentAvatarValid() && gAgentAvatarp->isSitting() && RlvActions::canStand(); // [/RLVa:KB] // return isAgentAvatarValid() && gAgentAvatarp->isSitting(); } diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index 09ebecec2c04194e875a992d13c789720da19656..94cd5047634cf91de6c086d76139223aec70f344 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -104,7 +104,7 @@ #include "llvocache.h" // [RLVa:KB] - Checked: 2011-05-22 (RLVa-1.3.1a) #include "rlvactions.h" -#include "rlvhandler.h" +#include "rlvcommon.h" #include "rlvlocks.h" // [/RLVa:KB] @@ -698,7 +698,7 @@ bool LLViewerObject::isReturnable() } // [RLVa:KB] - Checked: 2011-05-28 (RLVa-1.4.0a) | Added: RLVa-1.4.0a - if ( (rlv_handler_t::isEnabled()) && (!rlvCanDeleteOrReturn(this)) ) + if ( (RlvActions::isRlvEnabled()) && (!rlvCanDeleteOrReturn(this)) ) { return false; } @@ -1443,7 +1443,7 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys, mText->setColor(LLColor4(coloru)); mText->setString(temp_string); // [RLVa:KB] - Checked: 2010-03-27 (RLVa-1.4.0a) | Added: RLVa-1.0.0f - if (rlv_handler_t::isEnabled()) + if (RlvActions::isRlvEnabled()) { mText->setObjectText(temp_string); } @@ -1827,7 +1827,7 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys, mText->setColor(LLColor4(coloru)); mText->setString(temp_string); // [RLVa:KB] - Checked: 2010-03-27 (RLVa-1.4.0a) | Added: RLVa-1.0.0f - if (rlv_handler_t::isEnabled()) + if (RlvActions::isRlvEnabled()) { mText->setObjectText(temp_string); } @@ -2021,7 +2021,7 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys, return retval; } // [RLVa:KB] - Checked: 2010-03-16 (RLVa-1.1.0k) | Added: RLVa-1.1.0k - if ( (rlv_handler_t::isEnabled()) && (sent_parentp->isAvatar()) && (sent_parentp->getID() == gAgent.getID()) ) + if ( (RlvActions::isRlvEnabled()) && (sent_parentp->isAvatar()) && (sent_parentp->getID() == gAgent.getID()) ) { // Rezzed object that's being worn as an attachment (we're assuming this will be due to llAttachToAvatar()) S32 idxAttachPt = ATTACHMENT_ID_FROM_STATE(getState()); diff --git a/indra/newview/llwearableitemslist.cpp b/indra/newview/llwearableitemslist.cpp index 3324d05a93201fab6dfdadc1035654ad310c76ee..682954a5e4e3e99d144497f19c6c42e0e189abeb 100644 --- a/indra/newview/llwearableitemslist.cpp +++ b/indra/newview/llwearableitemslist.cpp @@ -40,7 +40,7 @@ #include "llviewerattachmenu.h" #include "llvoavatarself.h" // [RLVa:KB] - Checked: 2011-05-22 (RLVa-1.3.1a) -#include "rlvhandler.h" +#include "rlvactions.h" #include "rlvlocks.h" // [/RLVa:KB] @@ -854,9 +854,9 @@ void LLWearableItemsList::ContextMenu::updateItemsVisibility(LLContextMenu* menu // [RLVa:KB] - Checked: 2010-09-04 (RLVa-1.2.1a) | Added: RLVa-1.2.1a // We'll enable a menu option if at least one item in the selection is wearable/removable - bool rlvCanWearReplace = !rlv_handler_t::isEnabled(); - bool rlvCanWearAdd = !rlv_handler_t::isEnabled(); - bool rlvCanRemove = !rlv_handler_t::isEnabled(); + bool rlvCanWearReplace = !RlvActions::isRlvEnabled(); + bool rlvCanWearAdd = !RlvActions::isRlvEnabled(); + bool rlvCanRemove = !RlvActions::isRlvEnabled(); // [/RLVa:KB] for (uuid_vec_t::const_iterator it = ids.begin(); it != ids.end(); ++it) @@ -901,7 +901,7 @@ void LLWearableItemsList::ContextMenu::updateItemsVisibility(LLContextMenu* menu } // [RLVa:KB] - Checked: 2010-09-04 (RLVa-1.2.1a) | Added: RLVa-1.2.1a - if (rlv_handler_t::isEnabled()) + if (RlvActions::isRlvEnabled()) { ERlvWearMask eWearMask = RLV_WEAR_LOCKED; switch (item->getType()) diff --git a/indra/newview/llworldmapview.cpp b/indra/newview/llworldmapview.cpp index 4b61841600f81bc1933fbfd32ce4a3ba7fbd8d5b..6f97e59a7e391d1c1da9856988cb4035e70bd90c 100644 --- a/indra/newview/llworldmapview.cpp +++ b/indra/newview/llworldmapview.cpp @@ -56,7 +56,8 @@ #include "llviewerwindow.h" #include "lltrans.h" // [RLVa:KB] - Checked: 2010-04-19 (RLVa-1.2.0f) -#include "rlvhandler.h" +#include "rlvactions.h" +#include "rlvcommon.h" // [/RLVa:KB] #include "llglheaders.h" @@ -464,7 +465,7 @@ void LLWorldMapView::draw() } // if (!mesg.empty()) // [RLVa:KB] - Checked: 2012-02-08 (RLVa-1.4.5) | Added: RLVa-1.4.5 - if ( (!mesg.empty()) && (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) ) + if ( (!mesg.empty()) && (RlvActions::canShowLocation()) ) // [/RLVa:KB] { font->renderUTF8( @@ -1001,7 +1002,7 @@ void LLWorldMapView::drawTracking(const LLVector3d& pos_global, const LLColor4& // if (label != "") // [RLVa:KB] - Checked: 2009-07-04 (RLVa-1.4.5) | Added: RLVa-1.0.0 - if ( (label != "") && (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) ) + if ( (label != "") && (RlvActions::canShowLocation()) ) // [/RLVa:KB] { font->renderUTF8( @@ -1064,7 +1065,7 @@ BOOL LLWorldMapView::handleToolTip( S32 x, S32 y, MASK mask ) // [RLVa:KB] - Checked: 2010-04-19 (RLVa-1.4.5) | Modified: RLVa-1.4.5 std::string message = llformat("%s (%s)", - (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) ? info->getName().c_str() : RlvStrings::getString(RLV_STRING_HIDDEN_REGION).c_str(), + (RlvActions::canShowLocation()) ? info->getName().c_str() : RlvStrings::getString(RLV_STRING_HIDDEN_REGION).c_str(), info->getAccessString().c_str()); // [/RLVa:KB] // std::string message = llformat("%s (%s)", info->getName().c_str(), info->getAccessString().c_str()); diff --git a/indra/newview/rlvactions.cpp b/indra/newview/rlvactions.cpp index 82b5620aeace0efbb21b8538287ce1e6c3a7b6d8..9b39175ab2d82526cc9e29ab53f99d6e455e9cc7 100644 --- a/indra/newview/rlvactions.cpp +++ b/indra/newview/rlvactions.cpp @@ -217,6 +217,25 @@ bool RlvActions::canShowNearbyAgents() return !gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNEARBY); } +// Handles: @chatwhisper, @chatnormal and @chatshout +EChatType RlvActions::checkChatVolume(EChatType chatType) +{ + // In vs Bhvr | whisper | normal | shout | n+w | n+s | s+w | s+n+w | + // --------------------------------------------------------------------------------- + // whisper | normal | - | - | normal | - | normal | normal | + // normal | - | whisper | - | whisper | whisper | - | whisper | + // shout | - | whisper | normal | whisper | whisper | normal | whisper | + + RlvHandler& rlvHandler = RlvHandler::instance(); + if ( ((CHAT_TYPE_SHOUT == chatType) || (CHAT_TYPE_NORMAL == chatType)) && (rlvHandler.hasBehaviour(RLV_BHVR_CHATNORMAL)) ) + chatType = CHAT_TYPE_WHISPER; + else if ( (CHAT_TYPE_SHOUT == chatType) && (rlvHandler.hasBehaviour(RLV_BHVR_CHATSHOUT)) ) + chatType = CHAT_TYPE_NORMAL; + else if ( (CHAT_TYPE_WHISPER == chatType) && (rlvHandler.hasBehaviour(RLV_BHVR_CHATWHISPER)) ) + chatType = CHAT_TYPE_NORMAL; + return chatType; +} + // ============================================================================ // Inventory // diff --git a/indra/newview/rlvactions.h b/indra/newview/rlvactions.h index 1f2049be3e0834b11ba9cce0345bb75969fa05cd..0f06c41428965fd0e35e5e8e4a3f20bf19c87924 100644 --- a/indra/newview/rlvactions.h +++ b/indra/newview/rlvactions.h @@ -17,6 +17,7 @@ #ifndef RLV_ACTIONS_H #define RLV_ACTIONS_H +#include "llchat.h" #include "rlvdefines.h" // ============================================================================ @@ -86,6 +87,7 @@ public: */ static bool canChangeActiveGroup(const LLUUID& idRlvObject = LLUUID::null); + /* * Returns true if the user is allowed to receive IMs from the specified sender (can be an avatar or a group) */ @@ -125,6 +127,11 @@ public: */ static bool canShowNearbyAgents(); + /* + * Checks if the user is allowed to use the specified volume in (main) chat and returns the appropriate chat volume type + */ + static EChatType checkChatVolume(EChatType chatType); + 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];