From 076f0e0800c1cd3d058ae50bf2d17e5b6e29632d Mon Sep 17 00:00:00 2001 From: John Preston Date: Thu, 22 Dec 2022 11:34:56 +0400 Subject: [PATCH] Fix General topic message links. --- Telegram/SourceFiles/apiwrap.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Telegram/SourceFiles/apiwrap.cpp b/Telegram/SourceFiles/apiwrap.cpp index 5d5b62118..a80c200fe 100644 --- a/Telegram/SourceFiles/apiwrap.cpp +++ b/Telegram/SourceFiles/apiwrap.cpp @@ -691,7 +691,11 @@ QString ApiWrap::exportDirectMessageLink( auto linkThreadId = MsgId(); auto linkThreadIsTopic = false; if (inRepliesContext) { - if (const auto rootId = item->replyToTop()) { + linkThreadIsTopic = item->history()->isForum(); + const auto rootId = linkThreadIsTopic + ? item->topicRootId() + : item->replyToTop(); + if (rootId) { const auto root = item->history()->owner().message( channel->id, rootId); @@ -711,7 +715,6 @@ QString ApiWrap::exportDirectMessageLink( } else { // Reply in a thread, maybe comment in a private channel. linkThreadId = rootId; - linkThreadIsTopic = (item->topicRootId() == rootId); } } }