diff options
author | George Hazan <ghazan@miranda.im> | 2020-02-07 18:11:52 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2020-02-07 18:11:52 +0300 |
commit | 3c7699f80c5c4b8be13731c36d4deb4c6cc8eefe (patch) | |
tree | e36481505b053c485986f168d864d1f5c517d862 | |
parent | 0f594b2f7ca05b59f96d6c444d96cd04c9c084fe (diff) |
fixes #2202 (ICQ: входящие изображения не помечаются прочитанными)
-rw-r--r-- | protocols/ICQ-WIM/src/proto.cpp | 11 | ||||
-rw-r--r-- | protocols/ICQ-WIM/src/proto.h | 1 | ||||
-rw-r--r-- | protocols/ICQ-WIM/src/server.cpp | 19 |
3 files changed, 21 insertions, 10 deletions
diff --git a/protocols/ICQ-WIM/src/proto.cpp b/protocols/ICQ-WIM/src/proto.cpp index 0e5cb32fb0..e36dbe39f8 100644 --- a/protocols/ICQ-WIM/src/proto.cpp +++ b/protocols/ICQ-WIM/src/proto.cpp @@ -319,16 +319,7 @@ int CIcqProto::OnDbEventRead(WPARAM, LPARAM hDbEvent) if (mir_strcmp(szProto, m_szModuleName)) return 0; - if (m_bOnline) { - m_impl.m_markRead.Start(200); - - IcqCacheItem *pCache = FindContactByUIN(GetUserId(hContact)); - if (pCache) { - mir_cslock lck(m_csMarkReadQueue); - if (m_arMarkReadQueue.indexOf(pCache) == -1) - m_arMarkReadQueue.insert(pCache); - } - } + MarkAsRead(hContact); return 0; } diff --git a/protocols/ICQ-WIM/src/proto.h b/protocols/ICQ-WIM/src/proto.h index 7c8100eca7..6a06db66db 100644 --- a/protocols/ICQ-WIM/src/proto.h +++ b/protocols/ICQ-WIM/src/proto.h @@ -240,6 +240,7 @@ class CIcqProto : public PROTO<CIcqProto> void EmailNotification(const wchar_t *pwszText); void GetPermitDeny(); wchar_t* GetUIN(MCONTACT hContact); + void MarkAsRead(MCONTACT hContact); void MoveContactToGroup(MCONTACT hContact, const wchar_t *pwszGroup, const wchar_t *pwszNewGroup); bool RetrievePassword(); void RetrieveUserHistory(MCONTACT, __int64 startMsgId, __int64 endMsgId = -1); diff --git a/protocols/ICQ-WIM/src/server.cpp b/protocols/ICQ-WIM/src/server.cpp index 40dde5a451..12b7a33f80 100644 --- a/protocols/ICQ-WIM/src/server.cpp +++ b/protocols/ICQ-WIM/src/server.cpp @@ -211,6 +211,23 @@ void CIcqProto::OnLoggedOut() ///////////////////////////////////////////////////////////////////////////////////////// +void CIcqProto::MarkAsRead(MCONTACT hContact) +{ + if (!m_bOnline) + return; + + m_impl.m_markRead.Start(200); + + IcqCacheItem *pCache = FindContactByUIN(GetUserId(hContact)); + if (pCache) { + mir_cslock lck(m_csMarkReadQueue); + if (m_arMarkReadQueue.indexOf(pCache) == -1) + m_arMarkReadQueue.insert(pCache); + } +} + +///////////////////////////////////////////////////////////////////////////////////////// + MCONTACT CIcqProto::ParseBuddyInfo(const JSONNode &buddy, MCONTACT hContact) { // user chat? @@ -407,6 +424,8 @@ void CIcqProto::ParseMessage(MCONTACT hContact, __int64 &lastMsgId, const JSONNo pReq->hContact = hContact; pReq << CHAR_PARAM("aimsid", m_aimsid) << CHAR_PARAM("previews", "600"); Push(pReq); + + MarkAsRead(hContact); return; } |