diff options
-rw-r--r-- | indra/newview/llbottomtray.cpp | 4 | ||||
-rw-r--r-- | indra/newview/llbottomtray.h | 2 | ||||
-rw-r--r-- | indra/newview/llchiclet.cpp | 18 | ||||
-rw-r--r-- | indra/newview/llchiclet.h | 2 |
4 files changed, 24 insertions, 2 deletions
diff --git a/indra/newview/llbottomtray.cpp b/indra/newview/llbottomtray.cpp index 8389895479..6f2e666cc7 100644 --- a/indra/newview/llbottomtray.cpp +++ b/indra/newview/llbottomtray.cpp @@ -215,6 +215,10 @@ void LLBottomTray::onNewIM(const LLSD& data) } } +S32 LLBottomTray::getTotalUnreadIMCount() +{ + return getChicletPanel()->getTotalUnreadIMCount(); +} // virtual void LLBottomTray::onChange(EStatusType status, const std::string &channelURI, bool proximal) diff --git a/indra/newview/llbottomtray.h b/indra/newview/llbottomtray.h index 209fa7cca1..5cd3f15746 100644 --- a/indra/newview/llbottomtray.h +++ b/indra/newview/llbottomtray.h @@ -77,6 +77,8 @@ public: void onNewIM(const LLSD& data); + S32 getTotalUnreadIMCount(); + virtual void reshape(S32 width, S32 height, BOOL called_from_parent); virtual void onFocusLost(); diff --git a/indra/newview/llchiclet.cpp b/indra/newview/llchiclet.cpp index c7f77810df..c6fe076911 100644 --- a/indra/newview/llchiclet.cpp +++ b/indra/newview/llchiclet.cpp @@ -250,8 +250,7 @@ LLIMWellChiclet::~LLIMWellChiclet() void LLIMWellChiclet::messageCountChanged(const LLSD& session_data) { - S32 total_unread = LLIMMgr::instance().getNumberOfUnreadParticipantMessages(); - setCounter(total_unread); + setCounter(LLBottomTray::getInstance()->getTotalUnreadIMCount()); } /************************************************************************/ @@ -1529,6 +1528,21 @@ bool LLChicletPanel::isAnyIMFloaterDoked() return res; } +S32 LLChicletPanel::getTotalUnreadIMCount() +{ + S32 count = 0; + chiclet_list_t::const_iterator it = mChicletList.begin(); + for( ; mChicletList.end() != it; ++it) + { + LLIMChiclet* chiclet = dynamic_cast<LLIMChiclet*>(*it); + if(chiclet) + { + count += chiclet->getCounter(); + } + } + return count; +} + ////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////// diff --git a/indra/newview/llchiclet.h b/indra/newview/llchiclet.h index 353fc01c34..b3341f78a8 100644 --- a/indra/newview/llchiclet.h +++ b/indra/newview/llchiclet.h @@ -963,6 +963,8 @@ public: S32 getMinWidth() const { return mMinWidth; } + S32 getTotalUnreadIMCount(); + protected: LLChicletPanel(const Params&p); friend class LLUICtrlFactory; |