From d831775e2f59ef96362f551a13abe709cfa974b2 Mon Sep 17 00:00:00 2001 From: John Preston Date: Tue, 31 Oct 2023 11:19:57 +0400 Subject: [PATCH] Fix replying in the same history. --- Telegram/SourceFiles/data/data_histories.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Telegram/SourceFiles/data/data_histories.cpp b/Telegram/SourceFiles/data/data_histories.cpp index fb5a116cc..e1fd60f6f 100644 --- a/Telegram/SourceFiles/data/data_histories.cpp +++ b/Telegram/SourceFiles/data/data_histories.cpp @@ -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,