diff options
author | McCabe Maxsted | 2009-10-03 04:04:04 -0700 |
---|---|---|
committer | McCabe Maxsted | 2009-10-03 04:04:04 -0700 |
commit | 955eebfadc1299505d66eee7886ef41ea888a30a (patch) | |
tree | ff19f0460e5b676ae624d4109013801981b46651 /linden/indra | |
parent | Applied clickable object names for whisper/say/shout from Emerald viewer (diff) | |
download | meta-impy-955eebfadc1299505d66eee7886ef41ea888a30a.zip meta-impy-955eebfadc1299505d66eee7886ef41ea888a30a.tar.gz meta-impy-955eebfadc1299505d66eee7886ef41ea888a30a.tar.bz2 meta-impy-955eebfadc1299505d66eee7886ef41ea888a30a.tar.xz |
Object IMs are now prefixed with 'IM: '. As a side effect, names are now clickable when show IMs in chat is enabled
Diffstat (limited to 'linden/indra')
-rw-r--r-- | linden/indra/newview/llfloaterchat.cpp | 20 | ||||
-rw-r--r-- | linden/indra/newview/llviewermessage.cpp | 2 |
2 files changed, 17 insertions, 5 deletions
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& | |||
213 | } | 213 | } |
214 | 214 | ||
215 | // If the chat line has an associated url, link it up to the name. | 215 | // If the chat line has an associated url, link it up to the name. |
216 | if (!chat.mURL.empty() | 216 | if (!chat.mURL.empty() && |
217 | && (line.length() > chat.mFromName.length() && line.find(chat.mFromName,0) == 0)) | 217 | (line.length() > chat.mFromName.length() && |
218 | (line.find(chat.mFromName,0) == 4 || line.find(chat.mFromName,0) == 0))) | ||
218 | { | 219 | { |
219 | std::string start_line = line.substr(0, chat.mFromName.length() + 1); | 220 | std::string start_line; |
220 | line = line.substr(chat.mFromName.length() + 1); | 221 | if (line.find(chat.mFromName,0) == 4) // IMs are prefaced with "IM: " |
222 | { | ||
223 | start_line = line.substr(4, chat.mFromName.length() + 1); | ||
224 | std::string source = line.substr(0, 4); | ||
225 | edit->appendColoredText(source, false, prepend_newline, color); | ||
226 | line = line.substr(chat.mFromName.length() + 5); | ||
227 | } | ||
228 | else | ||
229 | { | ||
230 | start_line = line.substr(0, chat.mFromName.length() + 1); | ||
231 | line = line.substr(chat.mFromName.length() + 1); | ||
232 | } | ||
221 | const LLStyleSP &sourceStyle = LLStyleMap::instance().lookup(chat.mFromID,chat.mURL); | 233 | const LLStyleSP &sourceStyle = LLStyleMap::instance().lookup(chat.mFromID,chat.mURL); |
222 | edit->appendStyledText(start_line, false, prepend_newline, sourceStyle); | 234 | edit->appendStyledText(start_line, false, prepend_newline, sourceStyle); |
223 | prepend_newline = false; | 235 | 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) | |||
1929 | { | 1929 | { |
1930 | return; | 1930 | return; |
1931 | } | 1931 | } |
1932 | chat.mText = name + separator_string + message.substr(message_offset); | 1932 | chat.mText = std::string("IM: ") + name + separator_string + message.substr(message_offset); |
1933 | chat.mFromName = name; | 1933 | chat.mFromName = name; |
1934 | 1934 | ||
1935 | // Build a link to open the object IM info window. | 1935 | // Build a link to open the object IM info window. |