Skip to content
Snippets Groups Projects
Commit 6fe5807c authored by Cinder's avatar Cinder
Browse files

ALCH-220 - Negative channel chatbar support

parent d63317b5
No related branches found
No related tags found
No related merge requests found
......@@ -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);
}
......
......@@ -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);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment