summaryrefslogtreecommitdiff
path: root/indra/newview/llchathistory.cpp
diff options
context:
space:
mode:
authorEugene Mutavchi <emutavchi@productengine.com>2009-12-03 18:31:48 +0200
committerEugene Mutavchi <emutavchi@productengine.com>2009-12-03 18:31:48 +0200
commit276b782b8cfd7c814b84bbbf51fba5007f6c6031 (patch)
treee7651f5fcd5e261f08509d76cfe92835a214275d /indra/newview/llchathistory.cpp
parentc37c88960083ef05cc873be96d6dea082be05d2f (diff)
Implemented normal sub-task EXT-3035 (Made other participants' names clickable in IM chat log (old school chat log style))
--HG-- branch : product-engine
Diffstat (limited to 'indra/newview/llchathistory.cpp')
-rw-r--r--indra/newview/llchathistory.cpp27
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;