Commits

Marine Kelley committed 7287795

Change : allow to customize the send/receive IMs restriction messages (requires restart)
Change : allow to choose to remove the ability to send or receive OOC chat when prevented from hearing or chatting (requires restart)

  • Participants
  • Parent commits 9b429c2
  • Tags RLV 2.7.3

Comments (0)

Files changed (6)

indra/newview/RRInterface.cpp

 BOOL gRRenabled = TRUE;
 BOOL RRInterface::sRRNoSetEnv = FALSE;
 BOOL RRInterface::sRestrainedLoveDebug = FALSE;
+BOOL RRInterface::sCanOoc = TRUE;
+std::string RRInterface::sRecvimMessage = "The Resident you messaged is prevented from reading your instant messages at the moment, please try again later.";
+std::string RRInterface::sSendimMessage = "...";
+
 
 #if !defined(max)
 #define max(a, b)	((a) > (b) ? (a) : (b))
 			llinfos << "  checking " << it->second << llendl;
 		}
 		if (it->first==object_uuid.asString() && (command=="" || it->second.find (command)!=-1)) {
+			notify (object_uuid, it->second, "=y");
 			if (sRestrainedLoveDebug) {
 				llinfos << it->second << " => removed. " << llendl;
 			}
 			crunched = "...";
 		}
 	}
-	else if (msg.find ("((") != 0 || msg.find ("))") != msg.length () - 2) {
+	else if (msg.find ("((") != 0 || msg.find ("))") != msg.length () - 2 || !sCanOoc) {
 		// Only allow OOC chat, starting with "((" and ending with "))".
 		crunched = "...";
 	}

indra/newview/RRInterface.h

 
 #define RR_VIEWER_NAME "RestrainedLife"
 #define RR_VIEWER_NAME_NEW "RestrainedLove"
-#define RR_VERSION_NUM "2070200"
-#define RR_VERSION "2.07.02.00"
-#define RR_SLV_VERSION "2.7.2.18793"
+#define RR_VERSION_NUM "2070300"
+#define RR_VERSION "2.07.03.00"
+#define RR_SLV_VERSION "2.7.3.18793"
 
 #define RR_PREFIX "@"
 #define RR_SHARED_FOLDER "#RLV"
 
 	static BOOL sRRNoSetEnv;
 	static BOOL sRestrainedLoveDebug;
+	static BOOL sCanOoc; // when TRUE, the user can bypass a sendchat restriction by surrounding with (( and ))
+	static std::string sRecvimMessage; // message to replace an incoming IM, when under recvim
+	static std::string sSendimMessage; // message to replace an outgoing IM, when under sendim
 
 	// Allowed debug settings (initialized in the ctor)
 	std::string mAllowedU32;

indra/newview/app_settings/settings.xml

       <key>Value</key>
       <integer>1</integer>
     </map>
+    <key>RestrainedLoveCanOoc</key>
+    <map>
+      <key>Comment</key>
+      <string>When TRUE, you can bypass chat restrictions by surrounding your chat with (( and )). ATTENTION : This means Out-Of-Character chat and cheating with it is despised by other players. Requires a restart of your viewer.</string>
+      <key>Persist</key>
+      <integer>1</integer>
+      <key>Type</key>
+      <string>Boolean</string>
+      <key>Value</key>
+      <integer>1</integer>
+    </map>
+    <key>RestrainedLoveRecvimMessage</key>
+    <map>
+      <key>Comment</key>
+      <string>Message to show to people who try to IM you, when you're restricted from receiving IMs. Requires a restart of your viewer.</string>
+      <key>Persist</key>
+      <integer>1</integer>
+      <key>Type</key>
+      <string>String</string>
+      <key>Value</key>
+      <string>The Resident you messaged is prevented from reading your instant messages at the moment, please try again later.</string>
+    </map>
+    <key>RestrainedLoveSendimMessage</key>
+    <map>
+      <key>Comment</key>
+      <string>Message to show to people when you try to IM them and you're restricted from sending IMs. Requires a restart of your viewer.</string>
+      <key>Persist</key>
+      <integer>1</integer>
+      <key>Type</key>
+      <string>String</string>
+      <key>Value</key>
+      <string>...</string>
+    </map>
     <key>ShowProfileFloaters</key>
     <map>
       <key>Comment</key>

indra/newview/llimfloater.cpp

 			|| gAgent.mRRInterface.contains ("sendimto:"+mOtherParticipantUUID.asString())))
 		{
 			// user is forbidden to send IMs and the receiver is no exception
-			text = utf8str_to_wstring("*** IM blocked by sender's viewer"); // signal both the sender and the receiver
+			text = utf8str_to_wstring(RRInterface::sSendimMessage); // signal both the sender and the receiver
 		}
 //mk
 		if(!text.empty())

indra/newview/llstartup.cpp

 	gRRenabled = gSavedSettings.getBOOL("RestrainedLove");
 	RRInterface::sRRNoSetEnv = gSavedSettings.getBOOL("RestrainedLoveNoSetEnv");
 	RRInterface::sRestrainedLoveDebug = gSavedSettings.getBOOL("RestrainedLoveDebug");
+	RRInterface::sCanOoc = gSavedSettings.getBOOL("RestrainedLoveCanOoc");
+	RRInterface::sRecvimMessage = gSavedSettings.getString("RestrainedLoveRecvimMessage");
+	RRInterface::sSendimMessage = gSavedSettings.getString("RestrainedLoveSendimMessage");
 //mk
 	// HACK: These are things from the main loop that usually aren't done
 	// until initialization is complete, but need to be done here for things

indra/newview/llviewermessage.cpp

 				|| gAgent.mRRInterface.contains ("recvimfrom:"+from_id.asString())))
 			{
 				// agent is forbidden to receive IMs and the sender is no exception
-				buffer = separator_string + saved + "*** IM blocked by your viewer";
+				buffer = separator_string + saved + "...";
 				
 				// tell the sender the avatar could not read them
 				std::string my_name;
 				LLAgentUI::buildFullname(my_name);
 				my_name = my_name+" using viewer "+gAgent.mRRInterface.getVersion ();
-				std::string response = "The Resident you messaged is prevented from reading your instant messages at the moment, please try again later.";
+				std::string response = RRInterface::sRecvimMessage;
 				pack_instant_message(
 					gMessageSystem,
 					gAgent.getID(),