Add authorizationStateWaitPassword.has_passport_data.

This commit is contained in:
levlam 2023-02-22 15:59:36 +03:00
parent 1c43f3844b
commit b27eeda8bd
4 changed files with 8 additions and 2 deletions

View File

@ -135,8 +135,9 @@ authorizationStateWaitRegistration terms_of_service:termsOfService = Authorizati
//-Call checkAuthenticationPassword to provide the password, or requestAuthenticationPasswordRecovery to recover the password, or deleteAccount to delete the account after a week
//@password_hint Hint for the password; may be empty
//@has_recovery_email_address True, if a recovery email address has been set up
//@has_passport_data True, if some Telegram Passport elements were saved
//@recovery_email_address_pattern Pattern of the email address to which the recovery email was sent; empty until a recovery email has been sent
authorizationStateWaitPassword password_hint:string has_recovery_email_address:Bool recovery_email_address_pattern:string = AuthorizationState;
authorizationStateWaitPassword password_hint:string has_recovery_email_address:Bool has_passport_data:Bool recovery_email_address_pattern:string = AuthorizationState;
//@description The user has been successfully authorized. TDLib is now ready to answer general requests
authorizationStateReady = AuthorizationState;

View File

@ -120,7 +120,8 @@ tl_object_ptr<td_api::AuthorizationState> AuthManager::get_authorization_state_o
base64url_encode(login_token_));
case State::WaitPassword:
return make_tl_object<td_api::authorizationStateWaitPassword>(
wait_password_state_.hint_, wait_password_state_.has_recovery_, wait_password_state_.email_address_pattern_);
wait_password_state_.hint_, wait_password_state_.has_recovery_, wait_password_state_.has_secure_values_,
wait_password_state_.email_address_pattern_);
case State::WaitRegistration:
return make_tl_object<td_api::authorizationStateWaitRegistration>(
terms_of_service_.get_terms_of_service_object());
@ -758,6 +759,7 @@ void AuthManager::on_get_password_result(NetQueryPtr &result) {
wait_password_state_.srp_id_ = password->srp_id_;
wait_password_state_.hint_ = std::move(password->hint_);
wait_password_state_.has_recovery_ = password->has_recovery_;
wait_password_state_.has_secure_values_ = password->has_secure_values_;
break;
}
default:

View File

@ -107,6 +107,7 @@ class AuthManager final : public NetActor {
int64 srp_id_ = 0;
string hint_;
bool has_recovery_ = false;
bool has_secure_values_ = false;
string email_address_pattern_;
template <class StorerT>

View File

@ -30,6 +30,7 @@ void AuthManager::WaitPasswordState::store(StorerT &storer) const {
store(hint_, storer);
store(has_recovery_, storer);
store(email_address_pattern_, storer);
store(has_secure_values_, storer);
}
template <class ParserT>
@ -44,6 +45,7 @@ void AuthManager::WaitPasswordState::parse(ParserT &parser) {
parse(hint_, parser);
parse(has_recovery_, parser);
parse(email_address_pattern_, parser);
parse(has_secure_values_, parser);
}
template <class StorerT>