Fix check_dialog_username.
GitOrigin-RevId: 47dd0a62c10f0bc8e91748f8197676f7b72aab2e
This commit is contained in:
parent
608ff3f45a
commit
8501dbedf8
@ -3190,7 +3190,7 @@ void ContactsManager::check_dialog_username(DialogId dialog_id, const string &us
|
||||
if (error.message() == "USERNAME_INVALID") {
|
||||
return promise.set_value(CheckDialogUsernameResult::Invalid);
|
||||
}
|
||||
promise.set_error(std::move(error));
|
||||
return promise.set_error(std::move(error));
|
||||
}
|
||||
|
||||
promise.set_value(result.ok() ? CheckDialogUsernameResult::Ok : CheckDialogUsernameResult::Occupied);
|
||||
|
@ -307,8 +307,7 @@ void PasswordManager::update_password_settings(UpdateSettings update_settings, P
|
||||
auto result_promise = PromiseCreator::lambda(
|
||||
[actor_id = actor_id(this), promise = std::move(promise)](Result<bool> r_update_settings) mutable {
|
||||
if (r_update_settings.is_error()) {
|
||||
promise.set_error(r_update_settings.move_as_error());
|
||||
return;
|
||||
return promise.set_error(r_update_settings.move_as_error());
|
||||
}
|
||||
if (!r_update_settings.ok()) {
|
||||
promise.set_error(Status::Error(5, "account_updatePasswordSettings returned false"));
|
||||
@ -323,8 +322,7 @@ void PasswordManager::update_password_settings(UpdateSettings update_settings, P
|
||||
PromiseCreator::lambda([=, actor_id = actor_id(this), result_promise = std::move(result_promise),
|
||||
update_settings = std::move(update_settings)](Result<PasswordFullState> r_state) mutable {
|
||||
if (r_state.is_error()) {
|
||||
result_promise.set_error(r_state.move_as_error());
|
||||
return;
|
||||
return result_promise.set_error(r_state.move_as_error());
|
||||
}
|
||||
send_closure(actor_id, &PasswordManager::do_update_password_settings, std::move(update_settings),
|
||||
r_state.move_as_ok(), std::move(result_promise));
|
||||
@ -420,8 +418,7 @@ void PasswordManager::do_update_password_settings(UpdateSettings update_settings
|
||||
void PasswordManager::get_state(Promise<State> promise) {
|
||||
do_get_state(PromiseCreator::lambda([promise = std::move(promise)](Result<PasswordState> r_state) mutable {
|
||||
if (r_state.is_error()) {
|
||||
promise.set_error(r_state.move_as_error());
|
||||
return;
|
||||
return promise.set_error(r_state.move_as_error());
|
||||
}
|
||||
promise.set_value(r_state.move_as_ok().as_td_api());
|
||||
}));
|
||||
|
@ -4706,8 +4706,7 @@ void Td::on_request(uint64 id, td_api::getRemoteFile &request) {
|
||||
auto r_file_id = file_manager_->from_persistent_id(
|
||||
request.remote_file_id_, request.file_type_ == nullptr ? FileType::Temp : from_td_api(*request.file_type_));
|
||||
if (r_file_id.is_error()) {
|
||||
auto error = r_file_id.move_as_error();
|
||||
send_closure(actor_id(this), &Td::send_error, id, std::move(error));
|
||||
send_closure(actor_id(this), &Td::send_error, id, r_file_id.move_as_error());
|
||||
} else {
|
||||
send_closure(actor_id(this), &Td::send_result, id, file_manager_->get_file_object(r_file_id.ok()));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user