From 4afc32d9f95dbfd9a4f7257898b235056808c448 Mon Sep 17 00:00:00 2001 From: levlam Date: Wed, 22 Apr 2020 12:16:52 +0300 Subject: [PATCH] Do not save yet_unsent_message_id to persistent_message_id correspondence for bots. GitOrigin-RevId: 850f7ac5fc0bb348985b02c46812a32b64018cc5 --- td/telegram/MessagesManager.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/td/telegram/MessagesManager.cpp b/td/telegram/MessagesManager.cpp index fa4a28a4..1785bd7b 100644 --- a/td/telegram/MessagesManager.cpp +++ b/td/telegram/MessagesManager.cpp @@ -22647,7 +22647,9 @@ void MessagesManager::remove_message_dialog_notifications(Dialog *d, MessageId m void MessagesManager::send_update_message_send_succeeded(Dialog *d, MessageId old_message_id, const Message *m) const { CHECK(m != nullptr); CHECK(d->is_update_new_chat_sent); - d->yet_unsent_message_id_to_persistent_message_id.emplace(old_message_id, m->message_id); + if (!td_->auth_manager_->is_bot()) { + d->yet_unsent_message_id_to_persistent_message_id.emplace(old_message_id, m->message_id); + } send_closure( G()->td(), &Td::send_update, make_tl_object(get_message_object(d->dialog_id, m), old_message_id.get())); @@ -23590,7 +23592,9 @@ void MessagesManager::fail_send_message(FullMessageId full_message_id, int error << debug_add_message_to_dialog_fail_reason_; LOG(INFO) << "Send updateMessageSendFailed for " << full_message_id; - d->yet_unsent_message_id_to_persistent_message_id.emplace(old_message_id, m->message_id); + if (!td_->auth_manager_->is_bot()) { + d->yet_unsent_message_id_to_persistent_message_id.emplace(old_message_id, m->message_id); + } send_closure(G()->td(), &Td::send_update, make_tl_object(get_message_object(dialog_id, m), old_message_id.get(), error_code, error_message));