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 //