Fix sending replies in forums.

This commit is contained in:
John Preston 2023-11-06 12:31:59 +04:00
parent 20ba417ddd
commit 5350c97f82

View file

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