diff options
author | George Hazan <ghazan@miranda.im> | 2017-01-09 17:20:24 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2017-01-09 17:20:24 +0300 |
commit | 9be4904efc5dcbb6a180875c0b746170edff20e7 (patch) | |
tree | 3c6dd25c9c97acf80586cdb7272396577470252b | |
parent | 2aff16cfed601355f871862d7143c43f3528243c (diff) |
fix for retrieving missing messages when reading channel list
-rw-r--r-- | protocols/Discord/src/dispatch.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/protocols/Discord/src/dispatch.cpp b/protocols/Discord/src/dispatch.cpp index 7f6365e085..307394c8ca 100644 --- a/protocols/Discord/src/dispatch.cpp +++ b/protocols/Discord/src/dispatch.cpp @@ -157,6 +157,10 @@ void CDiscordProto::OnCommandReady(const JSONNode &pRoot) pUser->bIsPrivate = true; setId(pUser->hContact, DB_KEY_CHANNELID, pUser->channelId); + + SnowFlake oldMsgId = getId(pUser->hContact, DB_KEY_LASTMSGID); + if (pUser->lastMessageId > oldMsgId) + RetrieveHistory(pUser->hContact, MSG_AFTER, oldMsgId); } } } @@ -207,9 +211,6 @@ void CDiscordProto::OnCommandUserUpdate(const JSONNode &pRoot) CMStringW wszNewHash(pRoot["avatar"].as_mstring()); if (mir_wstrcmp(wszOldHash, wszNewHash)) { setWString(hContact, DB_KEY_AVHASH, wszNewHash); - - PROTO_AVATAR_INFORMATION ai = {}; - ai.hContact = hContact; - GetAvatarInfo(GAIF_FORCE, (LPARAM)&ai); + RetrieveAvatar(hContact); } } |