From 5acff85fa901af41c911b3034e6af6c5260e14fd Mon Sep 17 00:00:00 2001 From: levlam Date: Thu, 21 Mar 2024 15:13:03 +0300 Subject: [PATCH] Handle MESSAGE_IDS_MISMATCH errors. --- td/telegram/MessagesManager.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/td/telegram/MessagesManager.cpp b/td/telegram/MessagesManager.cpp index dc43905ae..ffc6e30f8 100644 --- a/td/telegram/MessagesManager.cpp +++ b/td/telegram/MessagesManager.cpp @@ -3506,6 +3506,7 @@ class SendQuickReplyMessagesQuery final : public Td::ResultHandler { Promise promise_; vector random_ids_; DialogId dialog_id_; + QuickReplyShortcutId shortcut_id_; public: explicit SendQuickReplyMessagesQuery(Promise &&promise) : promise_(std::move(promise)) { @@ -3515,6 +3516,7 @@ class SendQuickReplyMessagesQuery final : public Td::ResultHandler { vector &&random_ids) { random_ids_ = random_ids; dialog_id_ = dialog_id; + shortcut_id_ = shortcut_id; auto input_peer = td_->dialog_manager_->get_input_peer(dialog_id_, AccessRights::Write); if (input_peer == nullptr) { @@ -3582,6 +3584,9 @@ class SendQuickReplyMessagesQuery final : public Td::ResultHandler { return; } td_->dialog_manager_->on_get_dialog_error(dialog_id_, status, "SendQuickReplyMessagesQuery"); + if (status.code() == 400 && status.message() == CSlice("MESSAGE_IDS_MISMATCH")) { + td_->quick_reply_manager_->reload_quick_reply_messages(shortcut_id_, Auto()); + } for (auto &random_id : random_ids_) { td_->messages_manager_->on_send_message_fail(random_id, status.clone()); }