From 60e71f5724571da42e7b03afc2cb31e35a2ffacc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Liru=20F=C3=A6rs?= Date: Sat, 16 Nov 2019 03:49:47 -0500 Subject: [PATCH] Fix Beware's issue with SinguReplaceLinks failing for system messages Fixes Teleport Offers in local being links Fixes System Messages in IMs not enforcing link replacement Fixes IM Chat History being loaded with replacement support, at the log point, we can only consider it text from an outside source. Changes IM Chat History color from hard coded grey to SystemChatColor --- indra/newview/llagent.cpp | 1 + indra/newview/llimpanel.cpp | 12 ++++++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index f5ea77a9d..22ba22f9e 100644 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -4973,6 +4973,7 @@ void LLAgent::onFoundLureDestination(LLSimInfo *siminfo) msg.append(llformat(" (%s)", maturity.c_str())); } LLChat chat(msg); + chat.mSourceType = CHAT_SOURCE_SYSTEM; LLFloaterChat::addChat(chat); } else diff --git a/indra/newview/llimpanel.cpp b/indra/newview/llimpanel.cpp index 7d1dedbda..5f7a0d083 100644 --- a/indra/newview/llimpanel.cpp +++ b/indra/newview/llimpanel.cpp @@ -813,16 +813,19 @@ void LLFloaterIMPanel::addHistoryLine(const std::string &utf8msg, LLColor4 incol std::string show_name = name; bool is_irc = false; + bool system = name.empty(); // 'name' is a sender name that we want to hotlink so that clicking on it opens a profile. - if (!name.empty()) // If name exists, then add it to the front of the message. + if (!system) // If name exists, then add it to the front of the message. { // Don't hotlink any messages from the system (e.g. "Second Life:"), so just add those in plain text. if (name == SYSTEM_FROM) { + system = true; mHistoryEditor->appendColoredText(name,false,prepend_newline,incolor); } else { + system = !from_user; // IRC style text starts with a colon here; empty names and system messages aren't irc style. static const LLCachedControl italicize("LiruItalicizeActions"); is_irc = italicize && utf8msg[0] != ':'; @@ -831,7 +834,7 @@ void LLFloaterIMPanel::addHistoryLine(const std::string &utf8msg, LLColor4 incol // Convert the name to a hotlink and add to message. LLStyleSP source_style = LLStyleMap::instance().lookupAgent(source); source_style->mItalic = is_irc; - mHistoryEditor->appendText(show_name,false,prepend_newline,source_style, false); + mHistoryEditor->appendText(show_name,false,prepend_newline,source_style, system); } prepend_newline = false; } @@ -842,7 +845,7 @@ void LLFloaterIMPanel::addHistoryLine(const std::string &utf8msg, LLColor4 incol style->setColor(incolor); style->mItalic = is_irc; style->mBold = from_user && gSavedSettings.getBOOL("SingularityBoldGroupModerator") && isModerator(source); - mHistoryEditor->appendText(utf8msg, false, prepend_newline, style, false); + mHistoryEditor->appendText(utf8msg, false, prepend_newline, style, system); } if (log_to_file @@ -1667,7 +1670,8 @@ void LLFloaterIMPanel::chatFromLogFile(LLLogChat::ELogLineType type, std::string } //self->addHistoryLine(line, LLColor4::grey, FALSE); - self->mHistoryEditor->appendColoredText(message, false, true, LLColor4::grey); + LLStyleSP style(new LLStyle(gSavedSettings.getColor4("SystemChatColor"))); + self->mHistoryEditor->appendText(message, false, true, style, false); } void LLFloaterIMPanel::showSessionStartError(