Treat bots as always online.

This commit is contained in:
levlam 2021-01-11 22:22:18 +03:00
parent 27d3fdd09d
commit 0acc29b1d2
2 changed files with 5 additions and 3 deletions

View File

@ -728,6 +728,8 @@ void AuthManager::on_get_authorization(tl_object_ptr<telegram_api::auth_Authoriz
td->schedule_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) {

View File

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