From a3830dee59e9014605746b3425e5378b64c584fe Mon Sep 17 00:00:00 2001 From: Igor Borovkov Date: Fri, 6 Nov 2009 17:03:48 +0200 Subject: implement normal subtask EXT-2265 IM unread messages counter should not be increased for system messages (comming from 'Second Life', zero uuid) --HG-- branch : product-engine --- indra/newview/llimfloater.cpp | 2 +- indra/newview/llimview.cpp | 4 ++-- indra/newview/llimview.h | 3 +++ 3 files changed, 6 insertions(+), 3 deletions(-) (limited to 'indra') diff --git a/indra/newview/llimfloater.cpp b/indra/newview/llimfloater.cpp index 83e1a333f7..a634a1b0fd 100644 --- a/indra/newview/llimfloater.cpp +++ b/indra/newview/llimfloater.cpp @@ -115,7 +115,7 @@ void LLIMFloater::onClose(bool app_quitting) /* static */ void LLIMFloater::newIMCallback(const LLSD& data){ - if (data["num_unread"].asInteger() > 0) + if (data["num_unread"].asInteger() > 0 || data["from_id"].asUUID().isNull()) { LLUUID session_id = data["session_id"].asUUID(); diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index 4f844ed8c8..ac5bd719e2 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -134,7 +134,6 @@ void LLIMModel::setActiveSessionID(const LLUUID& session_id) LLIMModel::LLIMModel() { addNewMsgCallback(LLIMFloater::newIMCallback); - addNoUnreadMsgsCallback(LLIMFloater::newIMCallback); addNewMsgCallback(toast_callback); } @@ -440,7 +439,8 @@ bool LLIMModel::addMessage(const LLUUID& session_id, const std::string& from, co addToHistory(session_id, from, from_id, utf8_text); if (log2file) logToFile(session_id, from, from_id, utf8_text); - session->mNumUnread++; + //we do not count system messages + if (from_id.notNull()) session->mNumUnread++; // notify listeners LLSD arg; diff --git a/indra/newview/llimview.h b/indra/newview/llimview.h index 769d49f388..bd55bd2c30 100644 --- a/indra/newview/llimview.h +++ b/indra/newview/llimview.h @@ -66,7 +66,10 @@ public: EInstantMessage mType; LLUUID mOtherParticipantID; std::vector mInitialTargetIDs; + + //does NOT include system messages S32 mNumUnread; + std::list mMsgs; LLVoiceChannel* mVoiceChannel; -- cgit v1.2.3