Fix continuation of auth key destroy after restart.

This commit is contained in:
levlam 2021-12-01 16:16:18 +03:00
parent a6c0902ad7
commit 1d3cf2c209

View File

@ -62,6 +62,7 @@ AuthManager::AuthManager(int32 api_id, const string &api_hash, ActorShared<> par
LOG(WARNING) << "Continue to log out"; LOG(WARNING) << "Continue to log out";
update_state(State::LoggingOut); update_state(State::LoggingOut);
} else if (auth_str == "destroy") { } else if (auth_str == "destroy") {
LOG(WARNING) << "Continue to destroy auth keys";
update_state(State::DestroyingKeys); update_state(State::DestroyingKeys);
} else { } else {
if (!load_state()) { if (!load_state()) {
@ -74,7 +75,8 @@ void AuthManager::start_up() {
if (state_ == State::LoggingOut) { if (state_ == State::LoggingOut) {
send_log_out_query(); send_log_out_query();
} else if (state_ == State::DestroyingKeys) { } else if (state_ == State::DestroyingKeys) {
destroy_auth_keys(); G()->net_query_dispatcher().destroy_auth_keys(
PromiseCreator::lambda([](Unit) { send_closure_later(G()->td(), &Td::destroy); }, PromiseCreator::Ignore()));
} }
} }
void AuthManager::tear_down() { void AuthManager::tear_down() {