Make SendCodeHelper::resend_code const.

This commit is contained in:
levlam 2021-11-24 17:19:16 +03:00
parent 30e4350689
commit b49d315868
2 changed files with 5 additions and 5 deletions

View File

@ -28,13 +28,10 @@ td_api::object_ptr<td_api::authenticationCodeInfo> SendCodeHelper::get_authentic
max(static_cast<int32>(next_code_timestamp_.in() + 1 - 1e-9), 0));
}
Result<telegram_api::auth_resendCode> SendCodeHelper::resend_code() {
Result<telegram_api::auth_resendCode> SendCodeHelper::resend_code() const {
if (next_code_info_.type == AuthenticationCodeInfo::Type::None) {
return Status::Error(400, "Authentication code can't be resend");
}
sent_code_info_ = next_code_info_;
next_code_info_ = {};
next_code_timestamp_ = {};
return telegram_api::auth_resendCode(phone_number_, phone_code_hash_);
}

View File

@ -19,9 +19,12 @@ namespace td {
class SendCodeHelper {
public:
void on_sent_code(telegram_api::object_ptr<telegram_api::auth_sentCode> sent_code);
td_api::object_ptr<td_api::authorizationStateWaitCode> get_authorization_state_wait_code() const;
td_api::object_ptr<td_api::authenticationCodeInfo> get_authentication_code_info_object() const;
Result<telegram_api::auth_resendCode> resend_code();
Result<telegram_api::auth_resendCode> resend_code() const;
using Settings = td_api::object_ptr<td_api::phoneNumberAuthenticationSettings>;