2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-09-05 08:55:59 +00:00

Pass FullReplyTo everywhere.

This commit is contained in:
John Preston
2023-10-10 10:49:22 +04:00
parent a77131dfd6
commit 4240568ea5
53 changed files with 964 additions and 744 deletions

View File

@@ -1526,8 +1526,7 @@ bool SessionController::switchInlineQuery(
};
auto draft = std::make_unique<Data::Draft>(
textWithTags,
to.currentReplyToId,
to.rootId,
to.currentReplyTo,
cursor,
Data::PreviewState::Allowed);
@@ -1539,11 +1538,12 @@ bool SessionController::switchInlineQuery(
std::make_shared<HistoryView::ScheduledMemento>(history),
params);
} else {
const auto topicRootId = to.currentReplyTo.topicRootId;
history->setLocalDraft(std::move(draft));
history->clearLocalEditDraft(to.rootId);
history->clearLocalEditDraft(topicRootId);
if (to.section == Section::Replies) {
const auto commentId = MsgId();
showRepliesForMessage(history, to.rootId, commentId, params);
showRepliesForMessage(history, topicRootId, commentId, params);
} else {
showPeerHistory(history->peer, params);
}
@@ -1560,7 +1560,7 @@ bool SessionController::switchInlineQuery(
.section = (thread->asTopic()
? Dialogs::EntryState::Section::Replies
: Dialogs::EntryState::Section::History),
.rootId = thread->topicRootId(),
.currentReplyTo = { .topicRootId = thread->topicRootId() },
};
return switchInlineQuery(entryState, bot, query);
}