diff options
author | George Hazan <ghazan@miranda.im> | 2019-02-23 19:16:49 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2019-02-23 19:16:49 +0300 |
commit | 47e83290f474e01aa8e247375abcd2bffb9a2bf5 (patch) | |
tree | 5d301325e43a23dd56e11e11dfe9956eeb602b93 /protocols/Discord/src/server.cpp | |
parent | 691b1c649ab54ebfbb66eb3cba707b132b1134a8 (diff) |
fixes #1843 ([discord] Group chat history is no longer retrieved on login)
Diffstat (limited to 'protocols/Discord/src/server.cpp')
-rw-r--r-- | protocols/Discord/src/server.cpp | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/protocols/Discord/src/server.cpp b/protocols/Discord/src/server.cpp index 1dd9cd104a..f1d1db3a5e 100644 --- a/protocols/Discord/src/server.cpp +++ b/protocols/Discord/src/server.cpp @@ -28,12 +28,8 @@ void CDiscordProto::RemoveFriend(SnowFlake id) ///////////////////////////////////////////////////////////////////////////////////////// // retrieves server history -void CDiscordProto::RetrieveHistory(MCONTACT hContact, CDiscordHistoryOp iOp, SnowFlake msgid, int iLimit) +void CDiscordProto::RetrieveHistory(CDiscordUser *pUser, CDiscordHistoryOp iOp, SnowFlake msgid, int iLimit) { - CDiscordUser *pUser = FindUser(getId(hContact, DB_KEY_ID)); - if (pUser == nullptr) - return; - CMStringA szUrl(FORMAT, "/channels/%lld/messages", pUser->channelId); AsyncHttpRequest *pReq = new AsyncHttpRequest(this, REQUEST_GET, szUrl, &CDiscordProto::OnReceiveHistory); pReq << INT_PARAM("limit", iLimit); @@ -138,7 +134,7 @@ void CDiscordProto::OnReceiveHistory(NETLIBHTTPREQUEST *pReply, AsyncHttpRequest // if we fetched 99 messages, but have smth more to go, continue fetching if (iNumMessages == 99 && lastId < pUser->lastMsgId) - RetrieveHistory(pUser->hContact, MSG_AFTER, lastId, 99); + RetrieveHistory(pUser, MSG_AFTER, lastId, 99); } ///////////////////////////////////////////////////////////////////////////////////////// |