From addeaede43a3283f5ec16a66221c6028ff7eb9e6 Mon Sep 17 00:00:00 2001 From: Ansariel Date: Sun, 22 Nov 2015 17:17:16 +0100 Subject: [PATCH] GrowlManager: Only query avatar name cache if the chat actually came from an avatar --- indra/newview/growlmanager.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/indra/newview/growlmanager.cpp b/indra/newview/growlmanager.cpp index baa3a38611..dec874debc 100644 --- a/indra/newview/growlmanager.cpp +++ b/indra/newview/growlmanager.cpp @@ -113,7 +113,7 @@ GrowlManager::GrowlManager() mNotificationConnection = LLNotifications::instance().getChannel("GrowlNotifications")->connectChanged(&onLLNotification); // Also hook into IM notifications. - mInstantMessageConnection = LLIMModel::instance().mNewMsgSignal.connect(&GrowlManager::onInstantMessage); + mInstantMessageConnection = LLIMModel::instance().addNewMsgCallback(&GrowlManager::onInstantMessage); // Hook into script dialogs mScriptDialogConnection = LLScriptFloaterManager::instance().addNewObjectCallback(&GrowlManager::onScriptDialog); @@ -286,8 +286,7 @@ bool GrowlManager::onLLNotification(const LLSD& notice) body = growl_notification->growlBody; LLStringUtil::format(body, substitutions); } - //TM:FS no need to log whats sent to growl - //LL_INFOS("GrowlLLNotification") << "Notice: " << title << ": " << body << LL_ENDL; + if (name == "ObjectGiveItem" || name == "OwnObjectGiveItem" || name == "ObjectGiveItemUnknownUser" || name == "UserGiveItem" || name == "SystemMessageTip") { LLUrlMatch urlMatch; @@ -340,10 +339,8 @@ void GrowlManager::onScriptDialog(const LLSD& data) { LLNotificationPtr notification = LLNotifications::instance().find(data["notification_id"].asUUID()); const std::string name = notification->getName(); - //LLSD payload = notification->getPayload(); LLSD substitutions = notification->getSubstitutions(); - //LL_INFOS("GrowlLLNotification") << "Script dialog: name=" << name << " - payload=" << payload << " subs=" << substitutions << LL_ENDL; if (gGrowlManager->mNotifications.find(name) != gGrowlManager->mNotifications.end()) { GrowlNotification* growl_notification = &gGrowlManager->mNotifications[name]; @@ -384,7 +381,14 @@ void GrowlManager::onNearbyChatMessage(const LLSD& chat) message = message.substr(3); } - LLAvatarNameCache::get(chat["from_id"].asUUID(), boost::bind(&GrowlManager::onAvatarNameCache, _2, message, GROWL_IM_MESSAGE_TYPE)); + if ((EChatSourceType)chat["source"].asInteger() == CHAT_SOURCE_AGENT) + { + LLAvatarNameCache::get(chat["from_id"].asUUID(), boost::bind(&GrowlManager::onAvatarNameCache, _2, message, GROWL_IM_MESSAGE_TYPE)); + } + else + { + gGrowlManager->performNotification(chat["from"].asString(), message, GROWL_IM_MESSAGE_TYPE); + } } }