From 2d0ca224ea7a05a38e51979d201e55b7e942c855 Mon Sep 17 00:00:00 2001 From: Alexei Arabadji Date: Fri, 19 Mar 2010 17:27:54 +0200 Subject: =?UTF-8?q?fixed=20EXT-6472=20=E2=80=9CNo=20indication=20about=20n?= =?UTF-8?q?ew=20message/offer=20if=20IM=20window=20is=20open=20but=20not?= =?UTF-8?q?=20in=20focus=E2=80=9D,=20allowed=20to=20increment=20IM=20messa?= =?UTF-8?q?ge=20counter=20when=20IM=20window=20is=20opened=20but=20doesn't?= =?UTF-8?q?=20have=20focus=20and=20reset=20IM=20counter=20when=20IM=20wind?= =?UTF-8?q?ow=20get=20focus;=20reviewed=20by=20Mike=20Antipov=20at=20https?= =?UTF-8?q?://codereview.productengine.com/secondlife/r/76/?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --HG-- branch : product-engine --- indra/newview/llimview.cpp | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) (limited to 'indra/newview/llimview.cpp') diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index 6ce06adc80..7a4febec20 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -608,10 +608,10 @@ bool LLIMModel::clearSession(const LLUUID& session_id) return true; } -void LLIMModel::getMessages(const LLUUID& session_id, std::list& messages, int start_index) +void LLIMModel::getMessagesSilently(const LLUUID& session_id, std::list& messages, int start_index) { LLIMSession* session = findIMSession(session_id); - if (!session) + if (!session) { llwarns << "session " << session_id << "does not exist " << llendl; return; @@ -619,7 +619,7 @@ void LLIMModel::getMessages(const LLUUID& session_id, std::list& messages, int i = session->mMsgs.size() - start_index; - for (std::list::iterator iter = session->mMsgs.begin(); + for (std::list::iterator iter = session->mMsgs.begin(); iter != session->mMsgs.end() && i > 0; iter++) { @@ -628,6 +628,16 @@ void LLIMModel::getMessages(const LLUUID& session_id, std::list& messages, messages.push_back(*iter); i--; } +} + +void LLIMModel::sendNoUnreadMessages(const LLUUID& session_id) +{ + LLIMSession* session = findIMSession(session_id); + if (!session) + { + llwarns << "session " << session_id << "does not exist " << llendl; + return; + } session->mNumUnread = 0; session->mParticipantUnreadMessageCount = 0; @@ -639,6 +649,13 @@ void LLIMModel::getMessages(const LLUUID& session_id, std::list& messages, mNoUnreadMsgsSignal(arg); } +void LLIMModel::getMessages(const LLUUID& session_id, std::list& messages, int start_index) +{ + getMessagesSilently(session_id, messages, start_index); + + sendNoUnreadMessages(session_id); +} + bool LLIMModel::addToHistory(const LLUUID& session_id, const std::string& from, const LLUUID& from_id, const std::string& utf8_text) { LLIMSession* session = findIMSession(session_id); -- cgit v1.2.3