Don't try to fail message edits while closing.

This commit is contained in:
levlam 2022-11-07 13:54:42 +03:00
parent 36d05295d6
commit 3a9ea05a50

View File

@ -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());