From e69b5b2a3a758022c48179c86fa5a5d246aabeba Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 2 Feb 2025 19:51:35 +0300 Subject: Telegram: - fix for the forums with more than 100 threads; - fix for the files receiving in threads --- protocols/Telegram/src/server.cpp | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'protocols/Telegram/src/server.cpp') diff --git a/protocols/Telegram/src/server.cpp b/protocols/Telegram/src/server.cpp index b8206f8a39..9e7974035f 100644 --- a/protocols/Telegram/src/server.cpp +++ b/protocols/Telegram/src/server.cpp @@ -607,7 +607,7 @@ void CTelegramProto::ProcessChat(TD::updateNewChat *pObj) if (hContact != INVALID_CONTACT_ID) { if (pUser->isForum) { pUser->wszNick = Utf2T(szTitle.c_str()); - SendQuery(new TD::getForumTopics(pUser->chatId, "", 0, 0, 0, 100)); + SendQuery(new TD::getForumTopics(pUser->chatId, "", 0, 0, 0, 100), &CTelegramProto::OnGetTopics, pUser); } else GcChangeTopic(pUser, szTitle); } @@ -972,13 +972,7 @@ void CTelegramProto::ProcessMessage(const TD::message *pMessage) Contact::RemoveFromList(pUser->hContact); } - MCONTACT hContact = GetRealContact(pUser); - if (pMessage->message_thread_id_) { - wchar_t buf[100]; - mir_snwprintf(buf, L"%lld_%lld", pMessage->chat_id_, pMessage->message_thread_id_); - if (auto *si = Chat_Find(buf, m_szModuleName)) - hContact = si->hContact; - } + MCONTACT hContact = GetRealContact(pUser, pMessage->message_thread_id_); if (m_bResidentChannels && pUser->isChannel && pUser->m_si) { GCEVENT gce = { pUser->m_si, GC_EVENT_MESSAGE }; -- cgit v1.2.3