Fix some uses after move.

This commit is contained in:
levlam 2021-11-10 20:05:41 +03:00
parent 33c689aacc
commit 2392cc7631
4 changed files with 12 additions and 11 deletions

View File

@ -1604,11 +1604,9 @@ void ConfigManager::process_app_config(tl_object_ptr<telegram_api::JSONValue> &c
auto current_value = get_json_value_string(std::move(sound_key_value->value_), Slice());
if (sound_key_value->key_ == "id") {
id = std::move(current_value);
}
if (sound_key_value->key_ == "access_hash") {
} else if (sound_key_value->key_ == "access_hash") {
access_hash = std::move(current_value);
}
if (sound_key_value->key_ == "file_reference_base64") {
} else if (sound_key_value->key_ == "file_reference_base64") {
file_reference_base64 = std::move(current_value);
}
}

View File

@ -37,7 +37,7 @@ Game::Game(Td *td, string title, string description, tl_object_ptr<telegram_api:
CHECK(photo != nullptr);
photo_ = get_photo(td->file_manager_.get(), std::move(photo), owner_dialog_id);
if (photo_.is_empty()) {
LOG(ERROR) << "Receive empty photo for game " << title;
LOG(ERROR) << "Receive empty photo for game " << title_;
photo_.id = 0; // to prevent null photo in td_api
}
if (document != nullptr) {

View File

@ -18065,7 +18065,8 @@ void MessagesManager::on_get_message_link_dialog(MessageLinkInfo &&info, Promise
return promise.set_error(Status::Error(500, "Chat not found"));
}
get_message_force_from_server(d, info.message_id,
auto message_id = info.message_id;
get_message_force_from_server(d, message_id,
PromiseCreator::lambda([actor_id = actor_id(this), info = std::move(info), dialog_id,
promise = std::move(promise)](Result<Unit> &&result) mutable {
if (result.is_error()) {
@ -18080,7 +18081,8 @@ void MessagesManager::on_get_message_link_message(MessageLinkInfo &&info, Dialog
Promise<MessageLinkInfo> &&promise) {
TRY_STATUS_PROMISE(promise, G()->close_status());
Message *m = get_message_force({dialog_id, info.message_id}, "on_get_message_link_message");
auto message_id = info.message_id;
Message *m = get_message_force({dialog_id, message_id}, "on_get_message_link_message");
if (info.comment_message_id == MessageId() || m == nullptr || !is_broadcast_channel(dialog_id) ||
!m->reply_info.is_comment || !is_active_message_reply_info(dialog_id, m->reply_info)) {
return promise.set_value(std::move(info));
@ -18102,7 +18104,7 @@ void MessagesManager::on_get_message_link_message(MessageLinkInfo &&info, Dialog
});
td_->create_handler<GetDiscussionMessageQuery>(std::move(query_promise))
->send(dialog_id, info.message_id, DialogId(m->reply_info.channel_id), MessageId());
->send(dialog_id, message_id, DialogId(m->reply_info.channel_id), MessageId());
}
void MessagesManager::on_get_message_link_discussion_message(MessageLinkInfo &&info, DialogId comment_dialog_id,
@ -18117,8 +18119,9 @@ void MessagesManager::on_get_message_link_discussion_message(MessageLinkInfo &&i
return promise.set_error(Status::Error(500, "Chat not found"));
}
auto comment_message_id = info.comment_message_id;
get_message_force_from_server(
d, info.comment_message_id,
d, comment_message_id,
PromiseCreator::lambda([info = std::move(info), promise = std::move(promise)](Result<Unit> &&result) mutable {
return promise.set_value(std::move(info));
}));
@ -30444,7 +30447,7 @@ void MessagesManager::set_dialog_theme_name(Dialog *d, string theme_name) {
d->is_theme_name_inited = true;
if (is_changed) {
LOG(INFO) << "Set " << d->dialog_id << " theme to \"" << theme_name << '"';
LOG(INFO) << "Set " << d->dialog_id << " theme to \"" << d->theme_name << '"';
send_update_chat_theme(d);
} else {
on_dialog_updated(d->dialog_id, "set_dialog_theme_name");

View File

@ -371,7 +371,7 @@ void ConnectionCreator::ping_proxy_resolved(int32 proxy_id, IPAddress ip_address
auto connection_promise = PromiseCreator::lambda(
[ip_address, promise = std::move(promise), actor_id = actor_id(this), transport_type = extra.transport_type,
debug_str = std::move(extra.debug_str)](Result<ConnectionData> r_connection_data) mutable {
debug_str = extra.debug_str](Result<ConnectionData> r_connection_data) mutable {
if (r_connection_data.is_error()) {
return promise.set_error(Status::Error(400, r_connection_data.error().public_message()));
}