diff --git a/indra/newview/fsconsoleutils.cpp b/indra/newview/fsconsoleutils.cpp index e4431efad7..5c55a73fa3 100644 --- a/indra/newview/fsconsoleutils.cpp +++ b/indra/newview/fsconsoleutils.cpp @@ -32,6 +32,7 @@ #include "lggcontactsets.h" #include "llagent.h" #include "llconsole.h" +#include "llfloaternearbychat.h" #include "llfloaterreg.h" #include "llimview.h" #include "llnotificationhandler.h" @@ -39,6 +40,13 @@ #include "llviewercontrol.h" #include "rlvhandler.h" +// static +BOOL FSConsoleUtils::isNearbyChatVisible() +{ + LLFloaterNearbyChat* nearby_chat = LLFloaterReg::getTypedInstance("nearby_chat", LLSD()); + return nearby_chat->getVisible(); +} + // static bool FSConsoleUtils::ProcessChatMessage(const LLChat& chat_msg, const LLSD &args) { @@ -96,7 +104,7 @@ bool FSConsoleUtils::ProcessChatMessage(const LLChat& chat_msg, const LLSD &args LLColor4 chatcolor; LLViewerChat::getChatColor(chat_msg, chatcolor); gConsole->addConsoleLine(consoleChat, chatcolor); - gConsole->setVisible(!LLFloaterReg::instanceVisible("nearby_chat", LLSD())); + gConsole->setVisible(!isNearbyChatVisible()); } else { @@ -119,7 +127,7 @@ bool FSConsoleUtils::ProcessChatMessage(const LLChat& chat_msg, const LLSD &args LLColor4 chatcolor; LLViewerChat::getChatColor(chat_msg, chatcolor); gConsole->addConsoleLine(consoleChat, chatcolor); - gConsole->setVisible(!LLFloaterReg::instanceVisible("nearby_chat", LLSD())); + gConsole->setVisible(!isNearbyChatVisible()); } return true; @@ -175,7 +183,7 @@ void FSConsoleUtils::onProcessChatAvatarNameLookup(const LLUUID& agent_id, const LLColor4 chatcolor; LLViewerChat::getChatColor(chat_msg, chatcolor); gConsole->addConsoleLine(consoleChat, chatcolor); - gConsole->setVisible(!LLFloaterReg::instanceVisible("nearby_chat", LLSD())); + gConsole->setVisible(!isNearbyChatVisible()); } //static @@ -272,5 +280,5 @@ void FSConsoleUtils::onProccessInstantMessageNameLookup(const LLUUID& agent_id, } gConsole->addConsoleLine("IM: " + senderName + delimiter + message, textColor); - gConsole->setVisible(!LLFloaterReg::instanceVisible("nearby_chat", LLSD())); + gConsole->setVisible(!isNearbyChatVisible()); } diff --git a/indra/newview/fsconsoleutils.h b/indra/newview/fsconsoleutils.h index f550a56f22..33af353bf6 100644 --- a/indra/newview/fsconsoleutils.h +++ b/indra/newview/fsconsoleutils.h @@ -39,7 +39,7 @@ public: static bool ProcessInstantMessage(const LLUUID& session_id, const LLUUID& from_id, const std::string& message); protected: - + static BOOL isNearbyChatVisible(); static void onProcessChatAvatarNameLookup(const LLUUID& agent_id, const LLAvatarName& av_name, const LLChat& chat_msg); static void onProccessInstantMessageNameLookup(const LLUUID& agent_id, const LLAvatarName& av_name, const std::string& message_str, const std::string& group);