@@ -389,8 +389,9 @@ class CliClient final : public Actor {
389
389
}
390
390
}
391
391
392
- void on_update_autorization_state (const td_api::AuthorizationState &state) {
393
- switch (state.get_id ()) {
392
+ void on_update_autorization_state (td_api::object_ptr<td_api::AuthorizationState> &&state) {
393
+ authorization_state_ = std::move (state);
394
+ switch (authorization_state_->get_id ()) {
394
395
case td_api::authorizationStateWaitTdlibParameters::ID: {
395
396
auto parameters = td_api::make_object<td_api::tdlibParameters>();
396
397
parameters->use_test_dc_ = use_test_dc_;
@@ -854,7 +855,7 @@ class CliClient final : public Actor {
854
855
break ;
855
856
case td_api::updateAuthorizationState::ID:
856
857
on_update_autorization_state (
857
- * (static_cast <const td_api::updateAuthorizationState *>(result.get ())->authorization_state_ ));
858
+ std::move (static_cast <td_api::updateAuthorizationState *>(result.get ())->authorization_state_ ));
858
859
break ;
859
860
case td_api::updateChatLastMessage::ID: {
860
861
auto message = static_cast <const td_api::updateChatLastMessage *>(result.get ())->last_message_ .get ();
@@ -1681,7 +1682,7 @@ class CliClient final : public Actor {
1681
1682
int32 op_not_found_count = 0 ;
1682
1683
1683
1684
if (op == " gas" ) {
1684
- send_request (td_api::make_object<td_api::getAuthorizationState>() );
1685
+ LOG (ERROR) << to_string (authorization_state_ );
1685
1686
} else if (op == " sap" || op == " sapn" ) {
1686
1687
send_request (
1687
1688
td_api::make_object<td_api::setAuthenticationPhoneNumber>(args, get_phone_number_authentication_settings ()));
@@ -4670,6 +4671,7 @@ class CliClient final : public Actor {
4670
4671
std::unordered_map<int32, double > being_downloaded_files_;
4671
4672
4672
4673
int64 my_id_ = 0 ;
4674
+ td_api::object_ptr<td_api::AuthorizationState> authorization_state_;
4673
4675
string schedule_date_;
4674
4676
string message_thread_id_;
4675
4677
int64 opened_chat_id_ = 0 ;
0 commit comments