mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-08-31 06:26:18 +00:00
Handle forum / topic links.
This commit is contained in:
@@ -659,6 +659,7 @@ QString ApiWrap::exportDirectMessageLink(
|
||||
auto linkItemId = item->id;
|
||||
auto linkCommentId = MsgId();
|
||||
auto linkThreadId = MsgId();
|
||||
auto linkThreadIsTopic = false;
|
||||
if (inRepliesContext) {
|
||||
if (const auto rootId = item->replyToTop()) {
|
||||
const auto root = item->history()->owner().message(
|
||||
@@ -680,6 +681,7 @@ QString ApiWrap::exportDirectMessageLink(
|
||||
} else {
|
||||
// Reply in a thread, maybe comment in a private channel.
|
||||
linkThreadId = rootId;
|
||||
linkThreadIsTopic = (item->topicRootId() == rootId);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -692,7 +694,8 @@ QString ApiWrap::exportDirectMessageLink(
|
||||
+ (linkCommentId
|
||||
? "?comment=" + QString::number(linkCommentId.bare)
|
||||
: linkThreadId
|
||||
? "?thread=" + QString::number(linkThreadId.bare)
|
||||
? ((linkThreadIsTopic ? "?topic=" : "?thread=")
|
||||
+ QString::number(linkThreadId.bare))
|
||||
: "");
|
||||
if (linkChannel->hasUsername()
|
||||
&& !linkChannel->isMegagroup()
|
||||
|
Reference in New Issue
Block a user