summaryrefslogtreecommitdiff
path: root/indra/newview/llfloaterchat.cpp
diff options
context:
space:
mode:
authorJames Cook <james@lindenlab.com>2008-04-30 23:30:09 +0000
committerJames Cook <james@lindenlab.com>2008-04-30 23:30:09 +0000
commit36fccc3888c5dc318a8a235da8a5cae4faeb637d (patch)
tree021e439fe9fa3a285062d70bf0b8c0f799471681 /indra/newview/llfloaterchat.cpp
parentcf2a96375f62316b98c2dddd57f812f7565584be (diff)
svn merge -r 86190:86191 maint-ui-11-merge (EFFECTIVE MERGE: -r 84579:85724 maint-ui-11-qa).
Diffstat (limited to 'indra/newview/llfloaterchat.cpp')
-rw-r--r--indra/newview/llfloaterchat.cpp21
1 files changed, 17 insertions, 4 deletions
diff --git a/indra/newview/llfloaterchat.cpp b/indra/newview/llfloaterchat.cpp
index 22e418d60d..1d4801bd35 100644
--- a/indra/newview/llfloaterchat.cpp
+++ b/indra/newview/llfloaterchat.cpp
@@ -72,6 +72,7 @@
#include "lltexteditor.h"
#include "llfloaterhtml.h"
#include "llweb.h"
+#include "llstylemap.h"
// Used for LCD display
extern void AddNewIMToLCD(const LLString &newLine);
@@ -188,14 +189,26 @@ void LLFloaterChat::updateConsoleVisibility()
|| (getHost() && getHost()->isMinimized() )); // are we hosted in a minimized floater?
}
-void add_timestamped_line(LLViewerTextEditor* edit, const LLString& line, const LLColor4& color)
+void add_timestamped_line(LLViewerTextEditor* edit, const LLChat &chat, const LLColor4& color)
{
+ LLString line = chat.mText;
bool prepend_newline = true;
if (gSavedSettings.getBOOL("ChatShowTimestamps"))
{
edit->appendTime(prepend_newline);
prepend_newline = false;
}
+
+ // If the msg is not from an agent (not yourself though),
+ // extract out the sender name and replace it with the hotlinked name.
+ if (chat.mSourceType == CHAT_SOURCE_AGENT &&
+ chat.mFromID != LLUUID::null &&
+ (line.length() > chat.mFromName.length() && line.find(chat.mFromName,0) == 0))
+ {
+ line = line.substr(chat.mFromName.length());
+ const LLStyleSP &sourceStyle = LLStyleMap::instance().lookup(chat.mFromID);
+ edit->appendStyledText(chat.mFromName, false, false, &sourceStyle);
+ }
edit->appendColoredText(line, false, prepend_newline, color);
}
@@ -243,14 +256,14 @@ void LLFloaterChat::addChatHistory(const LLChat& chat, bool log_to_file)
if (!chat.mMuted)
{
- add_timestamped_line(history_editor, chat.mText, color);
- add_timestamped_line(history_editor_with_mute, chat.mText, color);
+ add_timestamped_line(history_editor, chat, color);
+ add_timestamped_line(history_editor_with_mute, chat, color);
}
else
{
// desaturate muted chat
LLColor4 muted_color = lerp(color, LLColor4::grey, 0.5f);
- add_timestamped_line(history_editor_with_mute, chat.mText, color);
+ add_timestamped_line(history_editor_with_mute, chat, color);
}
// add objects as transient speakers that can be muted