From 955eebfadc1299505d66eee7886ef41ea888a30a Mon Sep 17 00:00:00 2001 From: McCabe Maxsted Date: Sat, 3 Oct 2009 04:04:04 -0700 Subject: Object IMs are now prefixed with 'IM: '. As a side effect, names are now clickable when show IMs in chat is enabled --- linden/indra/newview/llfloaterchat.cpp | 20 ++++++++++++++++---- linden/indra/newview/llviewermessage.cpp | 2 +- 2 files changed, 17 insertions(+), 5 deletions(-) (limited to 'linden/indra') diff --git a/linden/indra/newview/llfloaterchat.cpp b/linden/indra/newview/llfloaterchat.cpp index 1f34ad0..a4082fd 100644 --- a/linden/indra/newview/llfloaterchat.cpp +++ b/linden/indra/newview/llfloaterchat.cpp @@ -213,11 +213,23 @@ void add_timestamped_line(LLViewerTextEditor* edit, LLChat chat, const LLColor4& } // If the chat line has an associated url, link it up to the name. - if (!chat.mURL.empty() - && (line.length() > chat.mFromName.length() && line.find(chat.mFromName,0) == 0)) + if (!chat.mURL.empty() && + (line.length() > chat.mFromName.length() && + (line.find(chat.mFromName,0) == 4 || line.find(chat.mFromName,0) == 0))) { - std::string start_line = line.substr(0, chat.mFromName.length() + 1); - line = line.substr(chat.mFromName.length() + 1); + std::string start_line; + if (line.find(chat.mFromName,0) == 4) // IMs are prefaced with "IM: " + { + start_line = line.substr(4, chat.mFromName.length() + 1); + std::string source = line.substr(0, 4); + edit->appendColoredText(source, false, prepend_newline, color); + line = line.substr(chat.mFromName.length() + 5); + } + else + { + start_line = line.substr(0, chat.mFromName.length() + 1); + line = line.substr(chat.mFromName.length() + 1); + } const LLStyleSP &sourceStyle = LLStyleMap::instance().lookup(chat.mFromID,chat.mURL); edit->appendStyledText(start_line, false, prepend_newline, sourceStyle); prepend_newline = false; diff --git a/linden/indra/newview/llviewermessage.cpp b/linden/indra/newview/llviewermessage.cpp index 47231fb..e01aa4f 100644 --- a/linden/indra/newview/llviewermessage.cpp +++ b/linden/indra/newview/llviewermessage.cpp @@ -1929,7 +1929,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) { return; } - chat.mText = name + separator_string + message.substr(message_offset); + chat.mText = std::string("IM: ") + name + separator_string + message.substr(message_offset); chat.mFromName = name; // Build a link to open the object IM info window. -- cgit v1.1