summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Antipov <mantipov@productengine.com>2009-12-07 14:39:34 +0200
committerMike Antipov <mantipov@productengine.com>2009-12-07 14:39:34 +0200
commit0445b02f350ad02a8f93713636ca7eebfb0db081 (patch)
tree52da53bb9983f5768fc402d162fe3340fc7b0c1d
parentfdb25e5add7305d8b92067f610eff1b5c18482de (diff)
Work on normal task EXT-3148 (Implement updating of the IM Well message counter). Completed
-- added updating count of unread messages in IM Well counter while closing any session. --HG-- branch : product-engine
-rw-r--r--indra/newview/llchiclet.cpp7
-rw-r--r--indra/newview/llchiclet.h9
2 files changed, 15 insertions, 1 deletions
diff --git a/indra/newview/llchiclet.cpp b/indra/newview/llchiclet.cpp
index 8d627dc4c2..6b9e616e47 100644
--- a/indra/newview/llchiclet.cpp
+++ b/indra/newview/llchiclet.cpp
@@ -135,6 +135,13 @@ LLIMWellChiclet::LLIMWellChiclet(const Params& p)
{
LLIMModel::instance().addNewMsgCallback(boost::bind(&LLIMWellChiclet::messageCountChanged, this, _1));
LLIMModel::instance().addNoUnreadMsgsCallback(boost::bind(&LLIMWellChiclet::messageCountChanged, this, _1));
+
+ LLIMMgr::getInstance()->addSessionObserver(this);
+}
+
+LLIMWellChiclet::~LLIMWellChiclet()
+{
+ LLIMMgr::getInstance()->removeSessionObserver(this);
}
void LLIMWellChiclet::messageCountChanged(const LLSD& session_data)
diff --git a/indra/newview/llchiclet.h b/indra/newview/llchiclet.h
index 8727e97aad..609ce16713 100644
--- a/indra/newview/llchiclet.h
+++ b/indra/newview/llchiclet.h
@@ -39,6 +39,7 @@
#include "lltextbox.h"
#include "lloutputmonitorctrl.h"
#include "llgroupmgr.h"
+#include "llimview.h"
class LLVoiceControlPanel;
class LLMenuGL;
@@ -787,9 +788,15 @@ protected:
*
* It displays a count of unread messages from other participants in all IM sessions.
*/
-class LLIMWellChiclet : public LLSysWellChiclet
+class LLIMWellChiclet : public LLSysWellChiclet, LLIMSessionObserver
{
friend class LLUICtrlFactory;
+public:
+ virtual void sessionAdded(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id) {}
+ virtual void sessionRemoved(const LLUUID& session_id) { messageCountChanged(LLSD()); }
+ virtual void sessionIDUpdated(const LLUUID& old_session_id, const LLUUID& new_session_id) {}
+
+ ~LLIMWellChiclet();
protected:
LLIMWellChiclet(const Params& p);