From 9fee0ee1bb0fda320fc3bb6aae60a4a69d34215d Mon Sep 17 00:00:00 2001 From: Arrehn Date: Fri, 24 Dec 2010 13:06:23 -0500 Subject: [PATCH] FEATURE: Flash nearby chat tab on updates --- indra/newview/llimfloatercontainer.h | 4 ++-- indra/newview/llnearbychat.cpp | 23 ++++++++++++++++++++++- 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/indra/newview/llimfloatercontainer.h b/indra/newview/llimfloatercontainer.h index 53dfcd78ff..ed1de3c142 100644 --- a/indra/newview/llimfloatercontainer.h +++ b/indra/newview/llimfloatercontainer.h @@ -58,13 +58,13 @@ public: static LLIMFloaterContainer* getInstance(); virtual void setMinimized(BOOL b); + + void onNewMessageReceived(const LLSD& data); // public so nearbychat can call it directly. TODO: handle via callback. -AO private: typedef std::map avatarID_panel_map_t; avatarID_panel_map_t mSessions; - - void onNewMessageReceived(const LLSD& data); }; #endif // LL_LLIMFLOATERCONTAINER_H diff --git a/indra/newview/llnearbychat.cpp b/indra/newview/llnearbychat.cpp index b08a8be7bf..29656a874c 100644 --- a/indra/newview/llnearbychat.cpp +++ b/indra/newview/llnearbychat.cpp @@ -203,6 +203,15 @@ void LLNearbyChat::addMessage(const LLChat& chat,bool archive,const LLSD &args) { return; } + + // IF tab mode active, flash our tab + if(isChatMultiTab()) + { + LLSD notification; + notification["session_id"] = getKey(); + LLIMFloaterContainer* floater_container = LLIMFloaterContainer::getInstance(); + floater_container->onNewMessageReceived(notification); + } if (gSavedPerAccountSettings.getBOOL("LogNearbyChat")) { @@ -231,10 +240,10 @@ void LLNearbyChat::onNearbySpeakers() LLSideTray::getInstance()->showPanel("panel_people",param); } - void LLNearbyChat::onNearbyChatContextMenuItemClicked(const LLSD& userdata) { } + bool LLNearbyChat::onNearbyChatCheckContextMenuItem(const LLSD& userdata) { std::string str = userdata.asString(); @@ -274,6 +283,18 @@ void LLNearbyChat::setVisible(BOOL visible) void LLNearbyChat::onOpen(const LLSD& key ) { llinfos << "onOPEN called..." << llendl; + // We override this to put nearbychat in the IM floater. -AO + if(isChatMultiTab()) + { + LLIMFloaterContainer* floater_container = LLIMFloaterContainer::getInstance(); + if (floater_container) + { + floater_container->showFloater(this, LLTabContainer::START); + } + setVisible(TRUE); + LLFloater::openFloater(key); + } + LLDockableFloater::onOpen(key); }