summaryrefslogtreecommitdiff
path: root/protocols/Discord/src/avatars.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2017-02-02 16:36:43 +0300
committerGeorge Hazan <ghazan@miranda.im>2017-02-02 16:36:43 +0300
commite1d7991a9095a848f0be2dd4a2677697b2e500da (patch)
treeddecdab8142634c6e2147adf0d8d9da203db7384 /protocols/Discord/src/avatars.cpp
parentfa650aaf5029cc11edf1540996e596a88acabbc1 (diff)
Discord: avatar change detector moved to the separate function
Diffstat (limited to 'protocols/Discord/src/avatars.cpp')
-rw-r--r--protocols/Discord/src/avatars.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/protocols/Discord/src/avatars.cpp b/protocols/Discord/src/avatars.cpp
index e44df7da04..fff069b252 100644
--- a/protocols/Discord/src/avatars.cpp
+++ b/protocols/Discord/src/avatars.cpp
@@ -211,3 +211,16 @@ INT_PTR CDiscordProto::SetMyAvatar(WPARAM, LPARAM lParam)
Push(new AsyncHttpRequest(this, REQUEST_PATCH, "/users/@me", NULL, &root));
return 0;
}
+
+/////////////////////////////////////////////////////////////////////////////////////////
+
+void CDiscordProto::CheckAvatarChange(MCONTACT hContact, const CMStringW &wszNewHash)
+{
+ ptrW wszOldAvatar(getWStringA(hContact, DB_KEY_AVHASH));
+
+ // if avatar's hash changed, we need to request a new one
+ if (mir_wstrcmp(wszNewHash, wszOldAvatar)) {
+ setWString(hContact, DB_KEY_AVHASH, wszNewHash);
+ RetrieveAvatar(hContact);
+ }
+}