diff options
author | Roxie Linden <roxie@lindenlab.com> | 2010-02-24 17:04:48 -0800 |
---|---|---|
committer | Roxie Linden <roxie@lindenlab.com> | 2010-02-24 17:04:48 -0800 |
commit | 6bb43e1369d957a041c796120e87a89ff3fa10ee (patch) | |
tree | 678e25f3b62ab90e2940dfcae5feafa1acaa8ffc /indra/newview/llchathistory.cpp | |
parent | ff52ac089f9ed67410f80fe66d0b997f0f2dafcc (diff) | |
parent | fc633fce71c6bdd43ab009558c7556f528335fe0 (diff) |
Automated merge up from viewer 2.0 trunk.
Some llvoiceclient changes duplicated changes that had already been
made in the voice modularization refactor, so the refactor versions
were used.
Diffstat (limited to 'indra/newview/llchathistory.cpp')
-rw-r--r-- | indra/newview/llchathistory.cpp | 27 |
1 files changed, 19 insertions, 8 deletions
diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp index cda3e3a419..9a1572364f 100644 --- a/indra/newview/llchathistory.cpp +++ b/indra/newview/llchathistory.cpp @@ -500,11 +500,23 @@ void LLChatHistory::appendMessage(const LLChat& chat, const bool use_plain_text_ style_params.font.size(font_size); style_params.font.style(input_append_params.font.style); + //whether to show colon after a name in header copy/past and in plain text mode + bool show_colon = chat.mChatType != CHAT_TYPE_SHOUT && chat.mChatType != CHAT_TYPE_WHISPER; + + //IRC styled /me messages. + bool irc_me = false; + + std::string prefix = chat.mText.substr(0, 4); + if (prefix == "/me " || prefix == "/me'") + { + irc_me = true; + } + if (use_plain_text_chat_history) { mEditor->appendText("[" + chat.mTimeStr + "] ", mEditor->getText().size() != 0, style_params); - if (utf8str_trim(chat.mFromName).size() != 0) + if (utf8str_trim(chat.mFromName).size() != 0 && !irc_me) { // Don't hotlink any messages from the system (e.g. "Second Life:"), so just add those in plain text. if ( chat.mFromName != SYSTEM_FROM && chat.mFromID.notNull() ) @@ -512,11 +524,11 @@ void LLChatHistory::appendMessage(const LLChat& chat, const bool use_plain_text_ LLStyle::Params link_params(style_params); link_params.fillFrom(LLStyleMap::instance().lookupAgent(chat.mFromID)); // Convert the name to a hotlink and add to message. - mEditor->appendText(chat.mFromName + ": ", false, link_params); + mEditor->appendText(chat.mFromName + (show_colon ? ": " : " "), false, link_params); } else { - mEditor->appendText(chat.mFromName + ": ", false, style_params); + mEditor->appendText(chat.mFromName + (show_colon ? ": " : " "), false, style_params); } } } @@ -562,21 +574,20 @@ void LLChatHistory::appendMessage(const LLChat& chat, const bool use_plain_text_ std::string header_text = "[" + chat.mTimeStr + "] "; if (utf8str_trim(chat.mFromName).size() != 0 && chat.mFromName != SYSTEM_FROM) - header_text += chat.mFromName + ": "; + header_text += chat.mFromName + (show_colon ? ": " : " "); mEditor->appendWidget(p, header_text, false); mLastFromName = chat.mFromName; mLastFromID = chat.mFromID; mLastMessageTime = new_message_time; } - //Handle IRC styled /me messages. - std::string prefix = chat.mText.substr(0, 4); - if (prefix == "/me " || prefix == "/me'") + + if (irc_me) { style_params.font.style = "ITALIC"; if (chat.mFromName.size() > 0) - mEditor->appendText(chat.mFromName, TRUE, style_params); + mEditor->appendText(chat.mFromName, FALSE, style_params); // Ensure that message ends with NewLine, to avoid losing of new lines // while copy/paste from text chat. See EXT-3263. mEditor->appendText(chat.mText.substr(3) + NEW_LINE, FALSE, style_params); |