diff options
Diffstat (limited to 'indra/newview/llchathistory.cpp')
-rw-r--r-- | indra/newview/llchathistory.cpp | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp index 5f1bbc7615..96b5ae5908 100644 --- a/indra/newview/llchathistory.cpp +++ b/indra/newview/llchathistory.cpp @@ -43,6 +43,7 @@ #include "lltrans.h" #include "llfloaterreg.h" #include "llmutelist.h" +#include "llstylemap.h" #include "llsidetray.h"//for blocked objects panel @@ -372,13 +373,25 @@ 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); - std::string header_text = "[" + chat.mTimeStr + "] "; - if (utf8str_trim(chat.mFromName).size() != 0 && chat.mFromName != SYSTEM_FROM) - header_text += chat.mFromName + ": "; - if (use_plain_text_chat_history) { - appendText(header_text, getText().size() != 0, style_params); + appendText("[" + chat.mTimeStr + "] ", getText().size() != 0, style_params); + + if (utf8str_trim(chat.mFromName).size() != 0) + { + // 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() ) + { + LLStyle::Params link_params(style_params); + link_params.fillFrom(LLStyleMap::instance().lookupAgent(chat.mFromID)); + // Convert the name to a hotlink and add to message. + appendText(chat.mFromName + ": ", false, link_params); + } + else + { + appendText(chat.mFromName + ": ", false, style_params); + } + } } else { @@ -420,6 +433,10 @@ void LLChatHistory::appendMessage(const LLChat& chat, const bool use_plain_text_ view->reshape(target_rect.getWidth(), view->getRect().getHeight()); view->setOrigin(target_rect.mLeft, view->getRect().mBottom); + std::string header_text = "[" + chat.mTimeStr + "] "; + if (utf8str_trim(chat.mFromName).size() != 0 && chat.mFromName != SYSTEM_FROM) + header_text += chat.mFromName + ": "; + appendWidget(p, header_text, false); mLastFromName = chat.mFromName; mLastFromID = chat.mFromID; |