diff options
Diffstat (limited to 'linden/indra/newview/llfloaterchat.cpp')
-rw-r--r-- | linden/indra/newview/llfloaterchat.cpp | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/linden/indra/newview/llfloaterchat.cpp b/linden/indra/newview/llfloaterchat.cpp index 1f34ad0..79c4aa6 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() && line.length() > chat.mFromName.length()) && |
217 | && (line.length() > chat.mFromName.length() && line.find(chat.mFromName,0) == 0)) | 217 | (line.find(chat.mFromName,0) == 0 || (line.find(chat.mFromName,0) == 4 && |
218 | color == gSavedSettings.getColor4("ObjectIMColor")))) // hack to make sure IMs in chat history don't hightlight | ||
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; |
@@ -536,6 +548,9 @@ LLColor4 get_text_color(const LLChat& chat) | |||
536 | text_color = gSavedSettings.getColor4("ObjectChatColor"); | 548 | text_color = gSavedSettings.getColor4("ObjectChatColor"); |
537 | } | 549 | } |
538 | break; | 550 | break; |
551 | case CHAT_SOURCE_OBJECT_IM: | ||
552 | text_color = gSavedSettings.getColor4("ObjectIMColor"); | ||
553 | break; | ||
539 | default: | 554 | default: |
540 | text_color.setToWhite(); | 555 | text_color.setToWhite(); |
541 | } | 556 | } |