@@ -126,30 +126,31 @@ class AuthManager final : public NetActor {
126126 TermsOfService terms_of_service_;
127127
128128 DbState () = default ;
129+
129130 static DbState wait_code (int32 api_id, string api_hash, SendCodeHelper send_code_helper) {
130- DbState state (State::WaitCode, api_id, api_hash);
131+ DbState state (State::WaitCode, api_id, std::move ( api_hash) );
131132 state.send_code_helper_ = std::move (send_code_helper);
132133 return state;
133134 }
134135
135136 static DbState wait_qr_code_confirmation (int32 api_id, string api_hash, vector<UserId> other_user_ids,
136137 string login_token, double login_token_expires_at) {
137- DbState state (State::WaitQrCodeConfirmation, api_id, api_hash);
138+ DbState state (State::WaitQrCodeConfirmation, api_id, std::move ( api_hash) );
138139 state.other_user_ids_ = std::move (other_user_ids);
139140 state.login_token_ = std::move (login_token);
140141 state.login_token_expires_at_ = login_token_expires_at;
141142 return state;
142143 }
143144
144145 static DbState wait_password (int32 api_id, string api_hash, WaitPasswordState wait_password_state) {
145- DbState state (State::WaitPassword, api_id, api_hash);
146+ DbState state (State::WaitPassword, api_id, std::move ( api_hash) );
146147 state.wait_password_state_ = std::move (wait_password_state);
147148 return state;
148149 }
149150
150151 static DbState wait_registration (int32 api_id, string api_hash, SendCodeHelper send_code_helper,
151152 TermsOfService terms_of_service) {
152- DbState state (State::WaitRegistration, api_id, api_hash);
153+ DbState state (State::WaitRegistration, api_id, std::move ( api_hash) );
153154 state.send_code_helper_ = std::move (send_code_helper);
154155 state.terms_of_service_ = std::move (terms_of_service);
155156 return state;
@@ -161,8 +162,8 @@ class AuthManager final : public NetActor {
161162 void parse (ParserT &parser);
162163
163164 private:
164- DbState (State state, int32 api_id, string api_hash)
165- : state_(state), api_id_(api_id), api_hash_(api_hash), state_timestamp_(Timestamp::now()) {
165+ DbState (State state, int32 api_id, string && api_hash)
166+ : state_(state), api_id_(api_id), api_hash_(std::move( api_hash) ), state_timestamp_(Timestamp::now()) {
166167 }
167168 };
168169
@@ -216,7 +217,6 @@ class AuthManager final : public NetActor {
216217
217218 void on_new_query (uint64 query_id);
218219 void on_query_error (Status status);
219- void on_query_error (uint64 id, Status status);
220220 void on_query_ok ();
221221 void start_net_query (NetQueryType net_query_type, NetQueryPtr net_query);
222222
@@ -232,7 +232,7 @@ class AuthManager final : public NetActor {
232232 void on_get_password_result (NetQueryPtr &result);
233233 void on_request_password_recovery_result (NetQueryPtr &result);
234234 void on_check_password_recovery_code_result (NetQueryPtr &result);
235- void on_authentication_result (NetQueryPtr &result, bool expected_flag );
235+ void on_authentication_result (NetQueryPtr &result, bool is_from_current_query );
236236 void on_log_out_result (NetQueryPtr &result);
237237 void on_delete_account_result (NetQueryPtr &result);
238238 void on_get_login_token (tl_object_ptr<telegram_api::auth_LoginToken> login_token);
@@ -242,7 +242,9 @@ class AuthManager final : public NetActor {
242242
243243 void update_state (State new_state, bool force = false , bool should_save_state = true );
244244 tl_object_ptr<td_api::AuthorizationState> get_authorization_state_object (State authorization_state) const ;
245- void send_ok (uint64 query_id);
245+
246+ static void send_ok (uint64 query_id);
247+ static void on_query_error (uint64 query_id, Status status);
246248
247249 void start_up () final ;
248250 void tear_down () final ;
0 commit comments