summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorDave SIMmONs <simon@lindenlab.com>2011-06-01 11:36:25 -0700
committerDave SIMmONs <simon@lindenlab.com>2011-06-01 11:36:25 -0700
commit694b0838bc80efc152e7ecda09ffdc7a944b7079 (patch)
tree3f2fe54fefefb2a0bdbbccf734d7255569c32945 /indra
parentd6f7526abf223b671b4e17be48dcc1e46e8f2fd8 (diff)
ER-949: Chat using '/me' style text displayed incorrectly. Reviewed by Kelly
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/llnearbychathandler.cpp24
1 files changed, 13 insertions, 11 deletions
diff --git a/indra/newview/llnearbychathandler.cpp b/indra/newview/llnearbychathandler.cpp
index 11dc496311..f157b20592 100644
--- a/indra/newview/llnearbychathandler.cpp
+++ b/indra/newview/llnearbychathandler.cpp
@@ -472,7 +472,8 @@ void LLNearbyChatHandler::initChannel()
-void LLNearbyChatHandler::processChat(const LLChat& chat_msg, const LLSD &args)
+void LLNearbyChatHandler::processChat(const LLChat& chat_msg, // WARNING - not really const, see hack below changing chat_msg.mText
+ const LLSD &args)
{
if(chat_msg.mMuted == TRUE)
return;
@@ -480,7 +481,17 @@ void LLNearbyChatHandler::processChat(const LLChat& chat_msg, const LLSD &args)
if(chat_msg.mText.empty())
return;//don't process empty messages
+ // Handle irc styled messages for toast panel
+ // HACK ALERT - changes mText, stripping out IRC style "/me" prefixes
LLChat& tmp_chat = const_cast<LLChat&>(chat_msg);
+ std::string original_message = tmp_chat.mText; // Save un-modified version of chat text
+ if (tmp_chat.mChatStyle == CHAT_STYLE_IRC)
+ {
+ if(!tmp_chat.mFromName.empty())
+ tmp_chat.mText = tmp_chat.mFromName + tmp_chat.mText.substr(3);
+ else
+ tmp_chat.mText = tmp_chat.mText.substr(3);
+ }
LLNearbyChat* nearby_chat = LLFloaterReg::getTypedInstance<LLNearbyChat>("nearby_chat", LLSD());
{
@@ -531,7 +542,7 @@ void LLNearbyChatHandler::processChat(const LLChat& chat_msg, const LLSD &args)
LLViewerChat::getChatColor(chat_msg,txt_color);
- LLFloaterScriptDebug::addScriptLine(chat_msg.mText,
+ LLFloaterScriptDebug::addScriptLine(original_message, // Send full message with "/me" style prefix
chat_msg.mFromName,
txt_color,
chat_msg.mFromID);
@@ -562,15 +573,6 @@ void LLNearbyChatHandler::processChat(const LLChat& chat_msg, const LLSD &args)
|| !mChannel->getShowToasts() ) // to prevent toasts in Busy mode
return;//no need in toast if chat is visible or if bubble chat is enabled
- // Handle irc styled messages for toast panel
- if (tmp_chat.mChatStyle == CHAT_STYLE_IRC)
- {
- if(!tmp_chat.mFromName.empty())
- tmp_chat.mText = tmp_chat.mFromName + tmp_chat.mText.substr(3);
- else
- tmp_chat.mText = tmp_chat.mText.substr(3);
- }
-
// arrange a channel on a screen
if(!mChannel->getVisible())
{