summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--protocols/Telegram/src/avatars.cpp6
-rw-r--r--protocols/Telegram/src/server.cpp3
2 files changed, 6 insertions, 3 deletions
diff --git a/protocols/Telegram/src/avatars.cpp b/protocols/Telegram/src/avatars.cpp
index 8751b744fd..0875ad21d2 100644
--- a/protocols/Telegram/src/avatars.cpp
+++ b/protocols/Telegram/src/avatars.cpp
@@ -65,9 +65,11 @@ INT_PTR CTelegramProto::SvcGetAvatarInfo(WPARAM, LPARAM lParam)
return GAIR_NOAVATAR;
}
-INT_PTR CTelegramProto::SvcGetMyAvatar(WPARAM, LPARAM)
+INT_PTR CTelegramProto::SvcGetMyAvatar(WPARAM wParam, LPARAM lParam)
{
- return 1;
+ auto wszFileName(GetAvatarFilename(0));
+ mir_wstrncpy((wchar_t *)wParam, wszFileName, lParam);
+ return 0;
}
INT_PTR CTelegramProto::SvcSetMyAvatar(WPARAM, LPARAM)
diff --git a/protocols/Telegram/src/server.cpp b/protocols/Telegram/src/server.cpp
index 9136b4c11d..8f27bcab27 100644
--- a/protocols/Telegram/src/server.cpp
+++ b/protocols/Telegram/src/server.cpp
@@ -1037,7 +1037,8 @@ void CTelegramProto::ProcessUser(TD::updateUser *pObj)
if (auto *pSmall = pPhoto->small_.get()) {
auto remoteId = pSmall->remote_->unique_id_;
auto storedId = getMStringA(pu->hContact, DBKEY_AVATAR_HASH);
- if (remoteId != storedId.c_str()) {
+ auto wszFileName = GetAvatarFilename(pu->hContact);
+ if (remoteId != storedId.c_str() || _waccess(wszFileName, 0)) {
if (!remoteId.empty()) {
pu->szAvatarHash = remoteId.c_str();
setString(pu->hContact, DBKEY_AVATAR_HASH, remoteId.c_str());