From 351c4f77094e97ef751811a32e0e4a0a63eba637 Mon Sep 17 00:00:00 2001
From: Kitty Barnett <develop@catznip.com>
Date: Sun, 20 Nov 2016 11:57:08 +0100
Subject: [PATCH] Refactoring carousel: prefer RlvActions over RlvHandler
 wherever possible   -> clean up some quick wins; no functionality changes

--HG--
branch : RLVa
---
 indra/newview/llattachmentsmgr.cpp         |  4 ++--
 indra/newview/llchatbar.cpp                | 17 ++++++-----------
 indra/newview/llfloaterimnearbychat.cpp    | 14 +++++---------
 indra/newview/llinventoryfunctions.cpp     |  8 ++++----
 indra/newview/llteleporthistorystorage.cpp |  4 ++--
 indra/newview/lltracker.cpp                |  3 ---
 indra/newview/llviewercamera.cpp           |  1 -
 indra/newview/llviewerdisplay.cpp          |  1 -
 indra/newview/llviewerkeyboard.cpp         |  3 ---
 indra/newview/llviewermenu.cpp             |  2 +-
 indra/newview/llviewerobject.cpp           | 10 +++++-----
 indra/newview/llwearableitemslist.cpp      | 10 +++++-----
 indra/newview/llworldmapview.cpp           |  9 +++++----
 indra/newview/rlvactions.cpp               | 19 +++++++++++++++++++
 indra/newview/rlvactions.h                 |  7 +++++++
 15 files changed, 61 insertions(+), 51 deletions(-)

diff --git a/indra/newview/llattachmentsmgr.cpp b/indra/newview/llattachmentsmgr.cpp
index 1c575dbd9f..73c3958b13 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 90f5fee4d9..41b65869d6 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 5f9ecbd30c..34dd9f9bf8 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 d11a7ea987..70e5b7dcc8 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 593960fa6c..3025ea57c6 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 5ff2771922..a32b033dba 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 4b0a36ddcd..d3facd7e31 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 f631ecc9c2..b43c32bc50 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 d84c1c93c8..3dd0c8e0db 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 28b04936d9..8594244b3d 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 09ebecec2c..94cd504763 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 3324d05a93..682954a5e4 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 4b61841600..6f97e59a7e 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 82b5620aea..9b39175ab2 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 1f2049be3e..0f06c41428 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];
-- 
GitLab