diff options
author | George Hazan <ghazan@miranda.im> | 2017-02-02 16:36:43 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2017-02-02 16:36:43 +0300 |
commit | e1d7991a9095a848f0be2dd4a2677697b2e500da (patch) | |
tree | ddecdab8142634c6e2147adf0d8d9da203db7384 /protocols/Discord/src/server.cpp | |
parent | fa650aaf5029cc11edf1540996e596a88acabbc1 (diff) |
Discord: avatar change detector moved to the separate function
Diffstat (limited to 'protocols/Discord/src/server.cpp')
-rw-r--r-- | protocols/Discord/src/server.cpp | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/protocols/Discord/src/server.cpp b/protocols/Discord/src/server.cpp index ece1f6a79d..5d86ec1721 100644 --- a/protocols/Discord/src/server.cpp +++ b/protocols/Discord/src/server.cpp @@ -146,8 +146,6 @@ void CDiscordProto::OnReceiveUserInfo(NETLIBHTTPREQUEST *pReply, AsyncHttpReques return; } - ptrW wszOldAvatar(getWStringA(hContact, DB_KEY_AVHASH)); - SnowFlake id = _wtoi64(root["id"].as_mstring()); setId(hContact, DB_KEY_ID, id); @@ -156,22 +154,16 @@ void CDiscordProto::OnReceiveUserInfo(NETLIBHTTPREQUEST *pReply, AsyncHttpReques setWString(hContact, DB_KEY_NICK, root["username"].as_mstring()); setWString(hContact, DB_KEY_EMAIL, root["email"].as_mstring()); - CMStringW wszNewAvatar(root["avatar"].as_mstring()); - setWString(hContact, DB_KEY_AVHASH, wszNewAvatar); - if (hContact == NULL) { m_ownId = id; - - // if avatar's hash changed, we need to request a new one - if (mir_wstrcmp(wszNewAvatar, wszOldAvatar)) - RetrieveAvatar(NULL); - OnLoggedIn(); } else { CDiscordUser *pUser = FindUser(id); ProcessType(pUser, root); } + + CheckAvatarChange(hContact, root["avatar"].as_mstring()); } ///////////////////////////////////////////////////////////////////////////////////////// |