summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--protocols/Telegram/src/avatars.cpp3
-rw-r--r--protocols/Telegram/src/proto.h2
-rw-r--r--protocols/Telegram/src/utils.cpp1
3 files changed, 4 insertions, 2 deletions
diff --git a/protocols/Telegram/src/avatars.cpp b/protocols/Telegram/src/avatars.cpp
index 3afcdc4ea2..b98646f8fb 100644
--- a/protocols/Telegram/src/avatars.cpp
+++ b/protocols/Telegram/src/avatars.cpp
@@ -255,7 +255,8 @@ void CTelegramProto::ProcessFile(TD::updateFile *pObj)
}
else MoveFileW(wszExistingFile, wszFullName);
- SmileyAdd_LoadContactSmileys(SMADD_FILE, m_szModuleName, wszFullName);
+ if (F->m_isSmiley)
+ SmileyAdd_LoadContactSmileys(SMADD_FILE, m_szModuleName, wszFullName);
mir_cslock lck(m_csFiles);
m_arFiles.remove(F);
diff --git a/protocols/Telegram/src/proto.h b/protocols/Telegram/src/proto.h
index 06f14d61e9..d19ecdfb33 100644
--- a/protocols/Telegram/src/proto.h
+++ b/protocols/Telegram/src/proto.h
@@ -81,7 +81,7 @@ struct TG_FILE_REQUEST : public MZeroedObject
CMStringA m_uniqueId, m_szUserId;
CMStringW m_destPath, m_fileName, m_wszDescr;
OFDTHREAD *ofd = 0;
- bool m_bRecv = false;
+ bool m_bRecv = false, m_isSmiley = false;
};
struct TG_USER : public MZeroedObject
diff --git a/protocols/Telegram/src/utils.cpp b/protocols/Telegram/src/utils.cpp
index b57bed69a9..0a1337da68 100644
--- a/protocols/Telegram/src/utils.cpp
+++ b/protocols/Telegram/src/utils.cpp
@@ -488,6 +488,7 @@ CMStringA CTelegramProto::GetMessageSticker(const TD::file *pFile, const char *p
auto *pFileId = pFile->remote_->unique_id_.c_str();
auto *pRequest = new TG_FILE_REQUEST(TG_FILE_REQUEST::AVATAR, pFile->id_, pFileId);
+ pRequest->m_isSmiley = true;
pRequest->m_destPath = GetAvatarPath() + L"\\Stickers";
CreateDirectoryW(pRequest->m_destPath, 0);