diff options
author | George Hazan <ghazan@miranda.im> | 2023-01-17 16:48:01 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2023-01-17 16:48:01 +0300 |
commit | 2769e6dfd3c3db280f40c1a09e0edbcee355045d (patch) | |
tree | 681ffd284d6fe1fa81c7e1796bbeee765b20cf55 /protocols/Telegram | |
parent | 82325bdfe25ff24ea97822867b1c89b0622eedf7 (diff) |
grrm...
Diffstat (limited to 'protocols/Telegram')
-rw-r--r-- | protocols/Telegram/src/avatars.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/protocols/Telegram/src/avatars.cpp b/protocols/Telegram/src/avatars.cpp index a322e9fb11..a4c841f3f5 100644 --- a/protocols/Telegram/src/avatars.cpp +++ b/protocols/Telegram/src/avatars.cpp @@ -85,15 +85,17 @@ void CTelegramProto::ProcessFile(TD::updateFile *pObj) for (auto &it : m_arUsers) {
if (it->szAvatarHash == pFile->remote_->unique_id_.c_str()) {
- CMStringW wszAvatarPath(GetAvatarFilename(it->hContact));
+ Utf2T wszExistingFile(pFile->local_->path_.c_str());
PROTO_AVATAR_INFORMATION pai;
pai.hContact = it->hContact;
- pai.format = ProtoGetAvatarFileFormat(pai.filename);
+ pai.format = ProtoGetAvatarFileFormat(wszExistingFile);
+ setByte(pai.hContact, DBKEY_AVATAR_TYPE, pai.format);
+
+ CMStringW wszAvatarPath(GetAvatarFilename(it->hContact));
wcsncpy_s(pai.filename, wszAvatarPath, _TRUNCATE);
- setByte(pai.hContact, DBKEY_AVATAR_TYPE, pai.format);
- MoveFileW(Utf2T(pFile->local_->path_.c_str()), wszAvatarPath);
+ MoveFileW(wszExistingFile, wszAvatarPath);
ProtoBroadcastAck(it->hContact, ACKTYPE_AVATAR, ACKRESULT_SUCCESS, &pai);
break;
|