From 6fe5807c40e5cf34a84b12e8ff751306f33bd139 Mon Sep 17 00:00:00 2001
From: Cinder <cinder@sdf.org>
Date: Sat, 6 Jun 2015 10:36:15 -0600
Subject: [PATCH] ALCH-220 - Negative channel chatbar support

---
 indra/newview/llchatbar.cpp             | 10 ++++++++--
 indra/newview/llfloaterimnearbychat.cpp | 10 ++++++++--
 2 files changed, 16 insertions(+), 4 deletions(-)

diff --git a/indra/newview/llchatbar.cpp b/indra/newview/llchatbar.cpp
index 118258447e..4d9617d395 100755
--- a/indra/newview/llchatbar.cpp
+++ b/indra/newview/llchatbar.cpp
@@ -313,11 +313,15 @@ LLWString LLChatBar::stripChannelNumber(const LLWString &mesg, S32* channel)
 	}
 	else if (mesg[0] == '/'
 			 && mesg[1]
-			 && LLStringOps::isDigit(mesg[1]))
+			 && (LLStringOps::isDigit(mesg[1])
+				 || mesg[1] == '-' ))
+		
 	{
 		// This a special "/20" speak on a channel
 		S32 pos = 0;
-
+		if(mesg[1] == '-')
+			pos++;
+		
 		// Copy the channel number into a string
 		LLWString channel_string;
 		llwchar c;
@@ -339,6 +343,8 @@ LLWString LLChatBar::stripChannelNumber(const LLWString &mesg, S32* channel)
 		}
 		
 		mLastSpecialChatChannel = strtol(wstring_to_utf8str(channel_string).c_str(), NULL, 10);
+		if(mesg[1] == '-')
+			mLastSpecialChatChannel = -mLastSpecialChatChannel;
 		*channel = mLastSpecialChatChannel;
 		return mesg.substr(pos, mesg.length() - pos);
 	}
diff --git a/indra/newview/llfloaterimnearbychat.cpp b/indra/newview/llfloaterimnearbychat.cpp
index 22791b6d3a..539bbc7503 100755
--- a/indra/newview/llfloaterimnearbychat.cpp
+++ b/indra/newview/llfloaterimnearbychat.cpp
@@ -627,7 +627,7 @@ void LLFloaterIMNearbyChat::sendChat( EChatType type )
 			}
 		}
 
-		mInputEditor->setText(LLStringExplicit(""));
+		mInputEditor->setText(LLStringUtil::null);
 	}
 
 	gAgent.stopTyping();
@@ -844,10 +844,14 @@ LLWString LLFloaterIMNearbyChat::stripChannelNumber(const LLWString &mesg, S32*
 	}
 	else if (mesg[0] == '/'
 			 && mesg[1]
-			 && LLStringOps::isDigit(mesg[1]))
+			 && (LLStringOps::isDigit(mesg[1])
+				 || mesg[1] == '-' ))
+
 	{
 		// This a special "/20" speak on a channel
 		S32 pos = 0;
+		if(mesg[1] == '-')
+			pos++;
 
 		// Copy the channel number into a string
 		LLWString channel_string;
@@ -870,6 +874,8 @@ LLWString LLFloaterIMNearbyChat::stripChannelNumber(const LLWString &mesg, S32*
 		}
 		
 		sLastSpecialChatChannel = strtol(wstring_to_utf8str(channel_string).c_str(), NULL, 10);
+		if(mesg[1] == '-')
+			sLastSpecialChatChannel = -sLastSpecialChatChannel;
 		*channel = sLastSpecialChatChannel;
 		return mesg.substr(pos, mesg.length() - pos);
 	}
-- 
GitLab