From f441613e79e33d4babddfffbdd86240a00a3d940 Mon Sep 17 00:00:00 2001 From: PanteraPolnocy Date: Tue, 8 Oct 2013 18:29:51 +0200 Subject: [PATCH] Partially reverting fix for FIRE-10178 (1f33a208e62b) because of problems with Growl, restoring old behaviour for it in Keyword Alerts Moving back gGrowlManager->notify to llviewerchat.cpp; "FSKeywords::notify" is now used only for triggering sound --- indra/newview/fskeywords.cpp | 14 -------------- indra/newview/llviewerchat.cpp | 16 ++++++++++++++++ 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/indra/newview/fskeywords.cpp b/indra/newview/fskeywords.cpp index 1716c5a237..f9e9ee3e97 100644 --- a/indra/newview/fskeywords.cpp +++ b/indra/newview/fskeywords.cpp @@ -4,7 +4,6 @@ #include "fskeywords.h" #include "llui.h" #include "llviewercontrol.h" -#include "growlmanager.h" // FIRE-10178: Keyword Alerts in group IM do not work unless the group is in the foreground #include //#include //for boost::ifind_first @@ -62,18 +61,5 @@ void FSKeywords::notify(const LLChat& chat) static LLCachedControl PlayModeUISndFSKeywordSound(gSavedSettings, "PlayModeUISndFSKeywordSound"); if(PlayModeUISndFSKeywordSound) LLUI::sAudioCallback(LLUUID(gSavedSettings.getString("UISndFSKeywordSound"))); - - std::string msg = chat.mFromName; - std::string prefix = chat.mText.substr(0, 4); - if(prefix == "/me " || prefix == "/me'" || prefix == "/ME " || prefix == "/ME'") - { - msg = msg + chat.mText.substr(3); - } - else - { - msg = msg + ": " + chat.mText; - } - - gGrowlManager->notify("Keyword Alert", msg, "Keyword Alert"); } // diff --git a/indra/newview/llviewerchat.cpp b/indra/newview/llviewerchat.cpp index 283e5ec73c..3147a98f22 100755 --- a/indra/newview/llviewerchat.cpp +++ b/indra/newview/llviewerchat.cpp @@ -133,6 +133,22 @@ void LLViewerChat::getChatColor(const LLChat& chat, LLColor4& r_color, bool is_l //Keyword alerts -KC if ((gAgentID != chat.mFromID || chat.mFromName == SYSTEM_FROM) && FSKeywords::getInstance()->chatContainsKeyword(chat, is_local)) { + static LLCachedControl FSEnableGrowl(gSavedSettings, "FSEnableGrowl"); + if (FSEnableGrowl) + { + std::string msg = chat.mFromName; + std::string prefix = chat.mText.substr(0, 4); + if(prefix == "/me " || prefix == "/me'" || prefix == "/ME " || prefix == "/ME'") + { + msg = msg + chat.mText.substr(3); + } + else + { + msg = msg + ": " + chat.mText; + } + gGrowlManager->notify("Keyword Alert", msg, "Keyword Alert"); + } + static LLCachedControl sFSKeywordChangeColor(gSavedPerAccountSettings, "FSKeywordChangeColor"); if (sFSKeywordChangeColor) {