Add pending_reset_date to passwordState.

This commit is contained in:
levlam 2021-06-29 01:52:09 +03:00
parent 18caf96c54
commit 36e874304f
3 changed files with 8 additions and 2 deletions

View File

@ -119,7 +119,8 @@ authorizationStateClosed = AuthorizationState;
//@description Represents the current state of 2-step verification @has_password True, if a 2-step verification password is set @password_hint Hint for the password; may be empty
//@has_recovery_email_address True, if a recovery email is set @has_passport_data True, if some Telegram Passport elements were saved
//@recovery_email_address_code_info Information about the recovery email address to which the confirmation email was sent; may be null
passwordState has_password:Bool password_hint:string has_recovery_email_address:Bool has_passport_data:Bool recovery_email_address_code_info:emailAddressAuthenticationCodeInfo = PasswordState;
//@pending_reset_date If not 0, point in time (Unix timestamp) after which password can be reset immediately using resetPassword
passwordState has_password:Bool password_hint:string has_recovery_email_address:Bool has_passport_data:Bool recovery_email_address_code_info:emailAddressAuthenticationCodeInfo pending_reset_date:int32 = PasswordState;
//@description Contains information about the current recovery email address @recovery_email_address Recovery email address
recoveryEmailAddress recovery_email_address:string = RecoveryEmailAddress;

View File

@ -746,6 +746,10 @@ void PasswordManager::do_get_state(Promise<PasswordState> promise) {
state.unconfirmed_recovery_email_address_pattern = std::move(password->email_unconfirmed_pattern_);
state.code_length = code_length;
if (password->flags_ & telegram_api::account_password::PENDING_RESET_DATE_MASK) {
state.pending_reset_date = td::max(password->pending_reset_date_, 0);
}
auto &new_state = state.new_state;
TRY_RESULT_PROMISE_ASSIGN(
promise, new_state,

View File

@ -104,6 +104,7 @@ class PasswordManager : public NetQueryCallback {
bool has_secure_values = false;
string unconfirmed_recovery_email_address_pattern;
int32 code_length = 0;
int32 pending_reset_date = 0;
string current_client_salt;
string current_server_salt;
@ -121,7 +122,7 @@ class PasswordManager : public NetQueryCallback {
unconfirmed_recovery_email_address_pattern, code_length);
}
return td_api::make_object<td_api::passwordState>(has_password, password_hint, has_recovery_email_address,
has_secure_values, std::move(code_info));
has_secure_values, std::move(code_info), pending_reset_date);
}
};