Fix General topic message links.

This commit is contained in:
John Preston 2022-12-22 11:34:56 +04:00
parent 191ea6f0f4
commit 076f0e0800

View file

@ -691,7 +691,11 @@ QString ApiWrap::exportDirectMessageLink(
auto linkThreadId = MsgId(); auto linkThreadId = MsgId();
auto linkThreadIsTopic = false; auto linkThreadIsTopic = false;
if (inRepliesContext) { 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( const auto root = item->history()->owner().message(
channel->id, channel->id,
rootId); rootId);
@ -711,7 +715,6 @@ QString ApiWrap::exportDirectMessageLink(
} else { } else {
// Reply in a thread, maybe comment in a private channel. // Reply in a thread, maybe comment in a private channel.
linkThreadId = rootId; linkThreadId = rootId;
linkThreadIsTopic = (item->topicRootId() == rootId);
} }
} }
} }