From cac1f4cd146e4e25d6b794f82ad485a35a9b5f24 Mon Sep 17 00:00:00 2001 From: levlam Date: Wed, 7 Sep 2022 12:53:14 +0300 Subject: [PATCH] Add passwordState.login_email_address_pattern. --- td/generate/scheme/td_api.tl | 3 ++- td/telegram/PasswordManager.cpp | 1 + td/telegram/PasswordManager.h | 4 +++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/td/generate/scheme/td_api.tl b/td/generate/scheme/td_api.tl index 42a78f5d1..5a4098c7d 100644 --- a/td/generate/scheme/td_api.tl +++ b/td/generate/scheme/td_api.tl @@ -144,8 +144,9 @@ 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 +//@login_email_address_pattern Pattern of the email address set up for logging in //@pending_reset_date If not 0, point in time (Unix timestamp) after which the 2-step verification 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; +passwordState has_password:Bool password_hint:string has_recovery_email_address:Bool has_passport_data:Bool recovery_email_address_code_info:emailAddressAuthenticationCodeInfo login_email_address_pattern:string 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; diff --git a/td/telegram/PasswordManager.cpp b/td/telegram/PasswordManager.cpp index e27f52c93..2a3b67098 100644 --- a/td/telegram/PasswordManager.cpp +++ b/td/telegram/PasswordManager.cpp @@ -786,6 +786,7 @@ void PasswordManager::do_get_state(Promise promise) { send_closure(actor_id, &PasswordManager::drop_cached_secret); } state.unconfirmed_recovery_email_code = {std::move(password->email_unconfirmed_pattern_), code_length}; + state.login_email_pattern = std::move(password->login_email_pattern_); if (password->flags_ & telegram_api::account_password::PENDING_RESET_DATE_MASK) { state.pending_reset_date = td::max(password->pending_reset_date_, 0); diff --git a/td/telegram/PasswordManager.h b/td/telegram/PasswordManager.h index 8b465bc94..45508706f 100644 --- a/td/telegram/PasswordManager.h +++ b/td/telegram/PasswordManager.h @@ -106,6 +106,7 @@ class PasswordManager final : public NetQueryCallback { bool has_recovery_email_address = false; bool has_secure_values = false; SentEmailCode unconfirmed_recovery_email_code; + string login_email_pattern; int32 pending_reset_date = 0; string current_client_salt; @@ -120,7 +121,8 @@ class PasswordManager final : public NetQueryCallback { State get_password_state_object() const { return td_api::make_object( has_password, password_hint, has_recovery_email_address, has_secure_values, - unconfirmed_recovery_email_code.get_email_address_authentication_code_info_object(), pending_reset_date); + unconfirmed_recovery_email_code.get_email_address_authentication_code_info_object(), login_email_pattern, + pending_reset_date); } };