diff options
author | George Hazan <ghazan@miranda.im> | 2017-01-08 23:27:13 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2017-01-08 23:27:13 +0300 |
commit | 9ab52162d7d1e0bdbf47d412fcfe83d533f0708b (patch) | |
tree | 9c8050b008642b41655bd773ca6e516212fba0ae /protocols/Discord/src/avatars.cpp | |
parent | f05340be7d013ac713fd24c19ff8304712223a73 (diff) |
better way of setting avatar either for me or any other user
Diffstat (limited to 'protocols/Discord/src/avatars.cpp')
-rw-r--r-- | protocols/Discord/src/avatars.cpp | 16 |
1 files changed, 1 insertions, 15 deletions
diff --git a/protocols/Discord/src/avatars.cpp b/protocols/Discord/src/avatars.cpp index aac083789b..ec984d4fa4 100644 --- a/protocols/Discord/src/avatars.cpp +++ b/protocols/Discord/src/avatars.cpp @@ -163,20 +163,6 @@ INT_PTR CDiscordProto::GetMyAvatar(WPARAM wParam, LPARAM lParam) ///////////////////////////////////////////////////////////////////////////////////////// -void CDiscordProto::OnReceiveMyAvatar(NETLIBHTTPREQUEST *pReply, AsyncHttpRequest *pReq) -{ - MCONTACT hContact = (MCONTACT)pReq->pUserInfo; - if (pReply->resultCode != 200) - return; - - JSONNode root = JSONNode::parse(pReply->pData); - if (!root) - return; - - setWString(hContact, DB_KEY_AVHASH, root["avatar"].as_mstring()); - CallService(MS_AV_REPORTMYAVATARCHANGED, (WPARAM)m_szModuleName, 0); -} - INT_PTR CDiscordProto::SetMyAvatar(WPARAM, LPARAM lParam) { CMStringW wszFileName(GetAvatarFilename(NULL)); @@ -213,6 +199,6 @@ INT_PTR CDiscordProto::SetMyAvatar(WPARAM, LPARAM lParam) szPayload.Append(ptrA(mir_base64_encode((BYTE*)szFileContents.get(), iFileLength))); JSONNode root; root << CHAR_PARAM("avatar", szPayload); - Push(new AsyncHttpRequest(this, REQUEST_PATCH, "/users/@me", &CDiscordProto::OnReceiveMyAvatar, &root)); + Push(new AsyncHttpRequest(this, REQUEST_PATCH, "/users/@me", NULL, &root)); return 0; } |