From bd839a0659cd0d5f795c7bf1ae9715028c499919 Mon Sep 17 00:00:00 2001
From: Kitty Barnett <none@none>
Date: Sun, 22 Aug 2010 21:51:05 +0200
Subject: [PATCH] - added : "RLVaDebugHideUnsetDuplicate" debug setting to
 suppress "unset" and "duplication" command restrictions from the debug output
     -> some restraints are far too "noisy", hopefully this will help prevent
 spamming local chat/chat history with redundant commands

--HG--
branch : RLVa
---
 indra/newview/app_settings/settings.xml | 11 +++++++++++
 indra/newview/llviewermessage.cpp       |  8 +++++---
 indra/newview/rlvcommon.h               |  1 +
 indra/newview/rlvdefines.h              |  1 +
 4 files changed, 18 insertions(+), 3 deletions(-)

diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index aafd0dabe1..7e5b2d9483 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -67,6 +67,17 @@
       <key>Value</key>
       <integer>0</integer>
     </map>
+    <key>RLVaDebugHideUnsetDuplicate</key>
+    <map>
+      <key>Comment</key>
+      <string>Suppresses reporting "unset" or "duplicate" command restrictions when RestrainedLoveDebug is TRUE</string>
+      <key>Persist</key>
+      <integer>1</integer>
+      <key>Type</key>
+      <string>Boolean</string>
+      <key>Value</key>
+      <integer>0</integer>
+    </map>
     <key>RLVaEnableCompositeFolders</key>
     <map>
       <key>Comment</key>
diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp
index 79aab877c9..e1dc197372 100644
--- a/indra/newview/llviewermessage.cpp
+++ b/indra/newview/llviewermessage.cpp
@@ -3350,7 +3350,9 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data)
 						std::string strCmd = *itToken;
 
 						ERlvCmdRet eRet = gRlvHandler.processCommand(from_id, strCmd, true);
-						if (RlvSettings::getDebug())
+						if ( (RlvSettings::getDebug()) &&
+							 ( (!RlvSettings::getDebugHideUnsetDup()) || 
+							   ((RLV_RET_SUCCESS_UNSET != eRet) && (RLV_RET_SUCCESS_DUPLICATE != eRet)) ) )
 						{
 							if ( RLV_RET_SUCCESS == (eRet & RLV_RET_SUCCESS) )	
 								pstr = &strExecuted;
@@ -3377,7 +3379,7 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data)
 					if (RlvForceWear::instanceExists())
 						RlvForceWear::instance().done();
 
-					if (!RlvSettings::getDebug())
+					if ( (!RlvSettings::getDebug()) || ((strExecuted.empty()) && (strFailed.empty()) && (strRetained.empty())) )
 						return;
 
 					// Silly people want comprehensive debug messages, blah :p
@@ -3396,7 +3398,7 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data)
 						verb = " retained: @";
 						mesg = strRetained;
 					}
-					else 
+					else
 					{
 						verb = ": @";
 						if (!strExecuted.empty())
diff --git a/indra/newview/rlvcommon.h b/indra/newview/rlvcommon.h
index 7d46534801..6fb2a9a880 100644
--- a/indra/newview/rlvcommon.h
+++ b/indra/newview/rlvcommon.h
@@ -53,6 +53,7 @@ public:
 	static BOOL getNoSetEnv()				{ return fNoSetEnv; }
 
 	static BOOL getDebugUIEnablers()		{ return rlvGetSettingBOOL(RLV_SETTING_DEBUGUIENABLERS, FALSE); }
+	static BOOL getDebugHideUnsetDup()		{ return rlvGetSettingBOOL(RLV_SETTING_DEBUGHIDEUNSETDUP, FALSE); }
 	#ifdef RLV_EXPERIMENTAL_COMPOSITEFOLDERS
 	static BOOL getEnableComposites()		{ return fCompositeFolders; }
 	#endif // RLV_EXPERIMENTAL_COMPOSITEFOLDERS
diff --git a/indra/newview/rlvdefines.h b/indra/newview/rlvdefines.h
index 01286071b1..e4b44e9095 100644
--- a/indra/newview/rlvdefines.h
+++ b/indra/newview/rlvdefines.h
@@ -281,6 +281,7 @@ enum ERlvAttachGroupType
 
 #define RLV_SETTING_CREATEOUTFITFOLDERS	"RLVaCreateFoldersOnSaveOutfit"
 #define RLV_SETTING_DEBUGUIENABLERS		"RLVaDebugUIEnablers"
+#define RLV_SETTING_DEBUGHIDEUNSETDUP   "RLVaDebugHideUnsetDuplicate"
 #define RLV_SETTING_ENABLECOMPOSITES	"RLVaEnableCompositeFolders"
 #define RLV_SETTING_ENABLELEGACYNAMING	"RLVaEnableLegacyNaming"
 #define RLV_SETTING_ENABLESHAREDWEAR	"RLVaEnableSharedWear"
-- 
GitLab