From 0acc29b1d2129b05bd790f9d6bd4b0f750ea3791 Mon Sep 17 00:00:00 2001 From: levlam Date: Mon, 11 Jan 2021 22:22:18 +0300 Subject: [PATCH] Treat bots as always online. --- td/telegram/AuthManager.cpp | 2 ++ td/telegram/Td.cpp | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/td/telegram/AuthManager.cpp b/td/telegram/AuthManager.cpp index e841e28c0..f73da39e5 100644 --- a/td/telegram/AuthManager.cpp +++ b/td/telegram/AuthManager.cpp @@ -728,6 +728,8 @@ void AuthManager::on_get_authorization(tl_object_ptrschedule_get_terms_of_service(0); td->schedule_get_promo_data(0); G()->td_db()->get_binlog_pmc()->set("fetched_marks_as_unread", "1"); + } else { + send_closure(G()->state_manager(), &StateManager::on_online, true); } send_closure(G()->config_manager(), &ConfigManager::request_config); if (query_id_ != 0) { diff --git a/td/telegram/Td.cpp b/td/telegram/Td.cpp index 002c555cb..467a1c468 100644 --- a/td/telegram/Td.cpp +++ b/td/telegram/Td.cpp @@ -4261,11 +4261,11 @@ Status Td::init(DbKey key) { } if (is_online_) { - if (auth_manager_->is_bot()) { - send_closure(G()->state_manager(), &StateManager::on_online, false); - } on_online_updated(true, true); } + if (auth_manager_->is_bot()) { + send_closure(G()->state_manager(), &StateManager::on_online, true); + } // Send binlog events to managers //