summaryrefslogtreecommitdiff
path: root/protocols/Telegram/src/groupchat.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/Telegram/src/groupchat.cpp')
-rw-r--r--protocols/Telegram/src/groupchat.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/protocols/Telegram/src/groupchat.cpp b/protocols/Telegram/src/groupchat.cpp
index a5c575c66d..e3a646dc03 100644
--- a/protocols/Telegram/src/groupchat.cpp
+++ b/protocols/Telegram/src/groupchat.cpp
@@ -197,13 +197,11 @@ int CTelegramProto::GcEventHook(WPARAM, LPARAM lParam)
if (mir_strcmpi(gch->si->pszModule, m_szModuleName))
return 0;
- auto userId = _wtoi64(gch->si->ptszID);
-
switch (gch->iType) {
case GC_USER_MESSAGE:
if (gch->ptszText && mir_wstrlen(gch->ptszText) > 0) {
rtrimw(gch->ptszText);
- if (auto *pUser = FindUser(userId)) {
+ if (auto *pUser = (TG_USER *)gch->si->pItemData) {
TD::int53 replyId = 0;
if (auto *pDlg = gch->si->pDlg) {
DB::EventInfo dbei(pDlg->m_hQuoteEvent, false);
@@ -416,11 +414,17 @@ void CTelegramProto::ProcessForum(TD::updateForumTopicInfo *pForum)
return;
}
+ auto *pInfo = pForum->info_.get();
if (pUser->m_si == nullptr) {
debugLogA("No parent chat for id %lld, skipping", pForum->chat_id_);
return;
}
+ if (pInfo->is_general_) {
+ SetId(pUser->m_si->hContact, pForum->info_->message_thread_id_, DBKEY_THREAD);
+ return;
+ }
+
wchar_t wszId[100];
mir_snwprintf(wszId, L"%lld_%lld", pForum->chat_id_, pForum->info_->message_thread_id_);