Remove UpdatesManager::init_sessions, because sessions are inited now by choosing of random one to send request, and init_sessions isn't called after temporary key is changed.

This commit is contained in:
levlam 2024-01-25 22:33:44 +03:00
parent 233633b705
commit 168bba072d
3 changed files with 0 additions and 27 deletions

View File

@ -571,7 +571,6 @@ void OptionManager::on_option_updated(Slice name) {
}
if (name == "session_count") {
G()->net_query_dispatcher().update_session_count();
td_->updates_manager_->init_sessions(false);
}
break;
case 'u':

View File

@ -1789,26 +1789,6 @@ void UpdatesManager::on_server_pong(tl_object_ptr<telegram_api::updates_state> &
}
}
void UpdatesManager::init_sessions(bool is_first) {
if (G()->close_flag() || !td_->auth_manager_->is_authorized()) {
return;
}
if (are_sessions_inited_ == is_first) {
return;
}
are_sessions_inited_ = true;
auto session_count = td_->option_manager_->get_option_integer("session_count", 1);
if (session_count <= 1) {
return;
}
LOG(INFO) << "Init " << session_count << " sessions";
for (int64 i = 0; i < session_count; i++) {
td_->create_handler<InitSessionQuery>()->send();
}
}
void UpdatesManager::process_get_difference_updates(
vector<tl_object_ptr<telegram_api::Message>> &&new_messages,
vector<tl_object_ptr<telegram_api::EncryptedMessage>> &&new_encrypted_messages,
@ -2215,8 +2195,6 @@ void UpdatesManager::after_get_difference() {
send_closure(G()->state_manager(), &StateManager::on_synchronized, true);
get_difference_start_time_ = 0.0;
init_sessions(true);
try_reload_data();
}

View File

@ -133,8 +133,6 @@ class UpdatesManager final : public Actor {
void ping_server();
void init_sessions(bool is_first);
bool running_get_difference() const {
return running_get_difference_;
}
@ -253,8 +251,6 @@ class UpdatesManager final : public Actor {
bool is_ping_sent_ = false;
bool are_sessions_inited_ = false;
bool running_get_difference_ = false;
int32 skipped_postponed_updates_after_start_ = 50000;
int32 last_confirmed_pts_ = 0;