From 797a117b60c11aac5cd27efd64f747cbeda3e8c6 Mon Sep 17 00:00:00 2001 From: levlam Date: Fri, 6 Dec 2019 00:39:39 +0300 Subject: [PATCH] Disable quick ack if reused media is sent. GitOrigin-RevId: 4e1166d9fd2faf103c3f59775565fc510906d02d --- td/telegram/MessagesManager.cpp | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/td/telegram/MessagesManager.cpp b/td/telegram/MessagesManager.cpp index e7eece3d9..963f96bfe 100644 --- a/td/telegram/MessagesManager.cpp +++ b/td/telegram/MessagesManager.cpp @@ -2127,15 +2127,7 @@ class SendMultiMediaActor : public NetActorOnce { auto query = G()->net_query_creator().create(create_storer(telegram_api::messages_sendMultiMedia( flags, false /*ignored*/, false /*ignored*/, false /*ignored*/, std::move(input_peer), reply_to_message_id.get_server_message_id().get(), std::move(input_single_media), schedule_date))); - if (G()->shared_config().get_option_boolean("use_quick_ack")) { - query->quick_ack_promise_ = PromiseCreator::lambda( - [random_ids = random_ids_](Unit) { - for (auto random_id : random_ids) { - send_closure(G()->messages_manager(), &MessagesManager::on_send_message_get_quick_ack, random_id); - } - }, - PromiseCreator::Ignore()); - } + // no quick ack, because file reference errors are very likely to happen query->debug("send to MessagesManager::MultiSequenceDispatcher"); send_closure(td->messages_manager_->sequence_dispatcher_, &MultiSequenceDispatcher::send_with_callback, std::move(query), actor_shared(this), sequence_dispatcher_id); @@ -2251,7 +2243,7 @@ class SendMediaActor : public NetActorOnce { std::move(entities), schedule_date); LOG(INFO) << "Send media: " << to_string(request); auto query = G()->net_query_creator().create(create_storer(request)); - if (G()->shared_config().get_option_boolean("use_quick_ack")) { + if (G()->shared_config().get_option_boolean("use_quick_ack") && was_uploaded_) { query->quick_ack_promise_ = PromiseCreator::lambda( [random_id](Unit) { send_closure(G()->messages_manager(), &MessagesManager::on_send_message_get_quick_ack, random_id);