2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

Support General topic somehow.

This commit is contained in:
John Preston
2022-11-29 15:54:47 +04:00
parent 8cd5105813
commit 57af221d39
12 changed files with 29 additions and 27 deletions

View File

@@ -689,7 +689,7 @@ QString ApiWrap::exportDirectMessageLink(
auto linkItemId = item->id;
auto linkCommentId = MsgId();
auto linkThreadId = MsgId();
//auto linkThreadIsTopic = false;
auto linkThreadIsTopic = false;
if (inRepliesContext) {
if (const auto rootId = item->replyToTop()) {
const auto root = item->history()->owner().message(
@@ -711,7 +711,7 @@ QString ApiWrap::exportDirectMessageLink(
} else {
// Reply in a thread, maybe comment in a private channel.
linkThreadId = rootId;
//linkThreadIsTopic = (item->topicRootId() == rootId);
linkThreadIsTopic = (item->topicRootId() == rootId);
}
}
}
@@ -723,7 +723,7 @@ QString ApiWrap::exportDirectMessageLink(
+ '/'
+ (linkCommentId
? (post + "?comment=" + QString::number(linkCommentId.bare))
: (linkThreadId/* && !linkThreadIsTopic*/)
: (linkThreadId && !linkThreadIsTopic)
? (post + "?thread=" + QString::number(linkThreadId.bare))
: linkThreadId
? (QString::number(linkThreadId.bare) + '/' + post)