From 3a9ea05a50c7c616df99000dfa173439b68a1632 Mon Sep 17 00:00:00 2001 From: levlam Date: Mon, 7 Nov 2022 13:54:42 +0300 Subject: [PATCH] Don't try to fail message edits while closing. --- td/telegram/MessagesManager.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/td/telegram/MessagesManager.cpp b/td/telegram/MessagesManager.cpp index 65891f397..d9325627d 100644 --- a/td/telegram/MessagesManager.cpp +++ b/td/telegram/MessagesManager.cpp @@ -13523,19 +13523,25 @@ void MessagesManager::hangup() { auto it = being_uploaded_files_.begin(); auto full_message_id = it->second.first; being_uploaded_files_.erase(it); - fail_send_message(full_message_id, Global::request_aborted_error()); + if (full_message_id.get_message_id().is_yet_unsent()) { + fail_send_message(full_message_id, Global::request_aborted_error()); + } } while (!being_uploaded_thumbnails_.empty()) { auto it = being_uploaded_thumbnails_.begin(); auto full_message_id = it->second.full_message_id; being_uploaded_thumbnails_.erase(it); - fail_send_message(full_message_id, Global::request_aborted_error()); + if (full_message_id.get_message_id().is_yet_unsent()) { + fail_send_message(full_message_id, Global::request_aborted_error()); + } } while (!being_loaded_secret_thumbnails_.empty()) { auto it = being_loaded_secret_thumbnails_.begin(); auto full_message_id = it->second.full_message_id; being_loaded_secret_thumbnails_.erase(it); - fail_send_message(full_message_id, Global::request_aborted_error()); + if (full_message_id.get_message_id().is_yet_unsent()) { + fail_send_message(full_message_id, Global::request_aborted_error()); + } } while (!being_sent_messages_.empty()) { on_send_message_fail(being_sent_messages_.begin()->first, Global::request_aborted_error());