Fix sending replies in forums.

This commit is contained in:
John Preston 2023-11-06 12:31:59 +04:00
parent 20ba417ddd
commit 5350c97f82
1 changed files with 9 additions and 6 deletions

View File

@ -48,14 +48,17 @@ MTPInputReplyTo ReplyToForMTP(
}
} else if (replyTo.messageId || replyTo.topicRootId) {
const auto to = LookupReplyTo(history, replyTo.messageId);
const auto replyingToTopic = replyTo.topicRootId
? history->peer->forumTopicFor(replyTo.topicRootId)
: nullptr;
const auto replyingToTopicId = replyTo.topicRootId
? replyTo.topicRootId
: Data::ForumTopic::kGeneralId;
const auto replyToTopicId = !to
? replyingToTopicId
: to->topicRootId()
? (replyingToTopic
? replyingToTopic->rootId()
: Data::ForumTopic::kGeneralId)
: (to ? to->topicRootId() : Data::ForumTopic::kGeneralId);
const auto replyToTopicId = to
? to->topicRootId()
: Data::ForumTopic::kGeneralId;
: replyingToTopicId;
const auto external = replyTo.messageId
&& (replyTo.messageId.peer != history->peer->id
|| replyingToTopicId != replyToTopicId);