From a05c86d6eca892b363757d75c0a52bcd60854bc6 Mon Sep 17 00:00:00 2001 From: levlam Date: Sat, 6 May 2023 21:47:10 +0300 Subject: [PATCH] Improve replies for bots. --- td/telegram/MessagesManager.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/td/telegram/MessagesManager.cpp b/td/telegram/MessagesManager.cpp index efdc44259..c447eab85 100644 --- a/td/telegram/MessagesManager.cpp +++ b/td/telegram/MessagesManager.cpp @@ -24576,10 +24576,9 @@ void MessagesManager::fix_server_reply_to_message_id(DialogId dialog_id, Message return; } - if (!message_id.is_scheduled() && !reply_in_dialog_id.is_valid() && reply_to_message_id >= message_id) { - if (!has_qts_messages(dialog_id)) { - LOG(ERROR) << "Receive reply to wrong " << reply_to_message_id << " in " << message_id << " in " << dialog_id; - } + if (!message_id.is_scheduled() && !reply_in_dialog_id.is_valid() && + ((reply_to_message_id > message_id && !has_qts_messages(dialog_id)) || reply_to_message_id == message_id)) { + LOG(ERROR) << "Receive reply to wrong " << reply_to_message_id << " in " << message_id << " in " << dialog_id; reply_to_message_id = MessageId(); } }