diff options
author | George Hazan <george.hazan@gmail.com> | 2025-02-02 19:51:35 +0300 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2025-02-02 19:51:35 +0300 |
commit | e69b5b2a3a758022c48179c86fa5a5d246aabeba (patch) | |
tree | 277ed48b3409cd1dd3067ab9eb3b98cfad6ff463 /protocols/Telegram/src/utils.cpp | |
parent | 9816616930533590a2884ee2758d71593d86d22b (diff) |
Telegram:
- fix for the forums with more than 100 threads;
- fix for the files receiving in threads
Diffstat (limited to 'protocols/Telegram/src/utils.cpp')
-rw-r--r-- | protocols/Telegram/src/utils.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/protocols/Telegram/src/utils.cpp b/protocols/Telegram/src/utils.cpp index 3d33b6b0c8..4e8a22192e 100644 --- a/protocols/Telegram/src/utils.cpp +++ b/protocols/Telegram/src/utils.cpp @@ -232,8 +232,14 @@ int CTelegramProto::GetDefaultMute(const TG_USER *pUser) return m_iDefaultMutePrivate;
}
-MCONTACT CTelegramProto::GetRealContact(const TG_USER *pUser)
+MCONTACT CTelegramProto::GetRealContact(const TG_USER *pUser, int64_t threadId)
{
+ if (threadId) {
+ wchar_t buf[100];
+ mir_snwprintf(buf, L"%lld_%lld", pUser->chatId, threadId);
+ if (auto *si = Chat_Find(buf, m_szModuleName))
+ return si->hContact;
+ }
return (pUser->hContact != 0) ? pUser->hContact : m_iSavedMessages;
}
@@ -452,7 +458,7 @@ bool CTelegramProto::GetMessageFile(const EmbeddedFile &F, TG_FILE_REQUEST::Type pRequest->m_fileName = Utf2T(pszFileName);
pRequest->m_fileSize = pFile->size_;
pRequest->m_bRecv = !F.pMsg->is_outgoing_;
- pRequest->m_hContact = GetRealContact(F.pUser);
+ pRequest->m_hContact = GetRealContact(F.pUser, F.pMsg->message_thread_id_);
if (mir_strlen(pszCaption))
F.szBody += pszCaption;
|