From 1634710bb1c4860feda7bb703fd01f5b2c23695d Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 27 Mar 2019 17:32:02 +0300 Subject: fixes #1903 (ICQ: auto dismiss tray notification if the mail was read in the browser) --- protocols/ICQ-WIM/src/poll.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/protocols/ICQ-WIM/src/poll.cpp b/protocols/ICQ-WIM/src/poll.cpp index 9296b90090..e2e5fb8796 100644 --- a/protocols/ICQ-WIM/src/poll.cpp +++ b/protocols/ICQ-WIM/src/poll.cpp @@ -220,9 +220,17 @@ void CIcqProto::ProcessNotification(const JSONNode &ev) const JSONNode &status = fld["mailbox.status"]; if (status) { + int iOldCount = m_unreadEmails; + JSONROOT root(status.as_string().c_str()); m_szMailBox = (*root)["email"].as_mstring(); m_unreadEmails = (*root)["unreadCount"].as_int(); + + // we've read/removed some messages from server + if (iOldCount > m_unreadEmails) { + g_clistApi.pfnRemoveEvent(0, 1); + return; + } // we notify about initial mail count only during login if (m_bFirstBos && m_unreadEmails > 0) { -- cgit v1.2.3