Fix replying in the same history.

This commit is contained in:
John Preston 2023-10-31 11:19:57 +04:00
parent bde39970a0
commit d831775e2f
1 changed files with 9 additions and 1 deletions

View File

@ -48,9 +48,17 @@ MTPInputReplyTo ReplyToForMTP(
}
} else if (replyTo.messageId || replyTo.topicRootId) {
const auto to = LookupReplyTo(history, replyTo.messageId);
const auto replyingToTopicId = replyTo.topicRootId
? replyTo.topicRootId
: Data::ForumTopic::kGeneralId;
const auto replyToTopicId = !to
? replyingToTopicId
: to->topicRootId()
? to->topicRootId()
: Data::ForumTopic::kGeneralId;
const auto external = replyTo.messageId
&& (replyTo.messageId.peer != history->peer->id
|| (replyTo.topicRootId != to->topicRootId()));
|| replyingToTopicId != replyToTopicId);
const auto quoteEntities = Api::EntitiesToMTP(
&history->session(),
replyTo.quote.entities,