From a2cf11ddc9a62ba2315b1b5ced5e69eb23017229 Mon Sep 17 00:00:00 2001 From: levlam Date: Mon, 23 Dec 2019 16:14:43 +0300 Subject: [PATCH] Do not request app config by bots. GitOrigin-RevId: 6bf7a97e0824827b9f23856407fe4d489a40f45b --- td/telegram/ConfigManager.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/td/telegram/ConfigManager.cpp b/td/telegram/ConfigManager.cpp index b426fd969..67b3de210 100644 --- a/td/telegram/ConfigManager.cpp +++ b/td/telegram/ConfigManager.cpp @@ -923,6 +923,11 @@ void ConfigManager::get_app_config(Promise return promise.set_error(Status::Error(500, "Request aborted")); } + auto auth_manager = G()->td().get_actor_unsafe()->auth_manager_.get(); + if (auth_manager != nullptr && auth_manager->is_bot()) { + return promise.set_value(nullptr); + } + get_app_config_queries_.push_back(std::move(promise)); if (get_app_config_queries_.size() == 1) { G()->net_query_dispatcher().dispatch_with_callback(