summaryrefslogtreecommitdiff
path: root/protocols/Discord/src/avatars.cpp
diff options
context:
space:
mode:
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);
+ }
+}