diff options
author | George Hazan <ghazan@miranda.im> | 2019-03-27 17:32:02 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2019-03-27 17:32:12 +0300 |
commit | 1634710bb1c4860feda7bb703fd01f5b2c23695d (patch) | |
tree | 830dc31106397a05f9795fc6e16b690adc4b7e34 /protocols/ICQ-WIM/src | |
parent | ed9d3f0d5c7a7aa4fee03100e3ae44eb06687eac (diff) |
fixes #1903 (ICQ: auto dismiss tray notification if the mail was read in the browser)
Diffstat (limited to 'protocols/ICQ-WIM/src')
-rw-r--r-- | protocols/ICQ-WIM/src/poll.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
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) { |