From c85f993de844ae585b3243f815e8023edca2e778 Mon Sep 17 00:00:00 2001 From: levlam Date: Thu, 7 Oct 2021 13:38:49 +0300 Subject: [PATCH] Improve captured actor_id names. --- td/telegram/ContactsManager.cpp | 20 ++++++++++---------- td/telegram/FileReferenceManager.cpp | 11 +++++------ 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/td/telegram/ContactsManager.cpp b/td/telegram/ContactsManager.cpp index fe83e0c3e..96e4a739f 100644 --- a/td/telegram/ContactsManager.cpp +++ b/td/telegram/ContactsManager.cpp @@ -9680,18 +9680,18 @@ void ContactsManager::update_user(User *u, UserId user_id, bool from_binlog, boo } } if (u->is_name_changed) { - td_->messages_manager_->on_dialog_title_updated(DialogId(user_id)); - for_each_secret_chat_with_user(user_id, - [messages_manager = td_->messages_manager_.get()](SecretChatId secret_chat_id) { - messages_manager->on_dialog_title_updated(DialogId(secret_chat_id)); - }); + auto messages_manager = td_->messages_manager_.get(); + messages_manager->on_dialog_title_updated(DialogId(user_id)); + for_each_secret_chat_with_user(user_id, [messages_manager](SecretChatId secret_chat_id) { + messages_manager->on_dialog_title_updated(DialogId(secret_chat_id)); + }); } if (u->is_photo_changed) { - td_->messages_manager_->on_dialog_photo_updated(DialogId(user_id)); - for_each_secret_chat_with_user(user_id, - [messages_manager = td_->messages_manager_.get()](SecretChatId secret_chat_id) { - messages_manager->on_dialog_photo_updated(DialogId(secret_chat_id)); - }); + auto messages_manager = td_->messages_manager_.get(); + messages_manager->on_dialog_photo_updated(DialogId(user_id)); + for_each_secret_chat_with_user(user_id, [messages_manager](SecretChatId secret_chat_id) { + messages_manager->on_dialog_photo_updated(DialogId(secret_chat_id)); + }); } if (u->is_status_changed && user_id != get_my_id()) { auto left_time = get_user_was_online(u, user_id) - G()->server_time_cached(); diff --git a/td/telegram/FileReferenceManager.cpp b/td/telegram/FileReferenceManager.cpp index d99bbf1ee..ed60fe6b2 100644 --- a/td/telegram/FileReferenceManager.cpp +++ b/td/telegram/FileReferenceManager.cpp @@ -226,14 +226,14 @@ void FileReferenceManager::send_query(Destination dest, FileSourceId file_source auto &node = nodes_[dest.node_id]; node.query->active_queries++; - auto promise = PromiseCreator::lambda([dest, file_source_id, file_reference_manager = G()->file_reference_manager(), - file_manager = G()->file_manager()](Result result) { + auto promise = PromiseCreator::lambda([dest, file_source_id, actor_id = actor_id(this), + file_manager_actor_id = G()->file_manager()](Result result) { if (G()->close_flag()) { VLOG(file_references) << "Ignore file reference repair from " << file_source_id << " during closing"; return; } - auto new_promise = PromiseCreator::lambda([dest, file_source_id, file_reference_manager](Result result) { + auto new_promise = PromiseCreator::lambda([dest, file_source_id, actor_id](Result result) { if (G()->close_flag()) { VLOG(file_references) << "Ignore file reference repair from " << file_source_id << " during closing"; return; @@ -243,11 +243,10 @@ void FileReferenceManager::send_query(Destination dest, FileSourceId file_source if (result.is_error()) { status = result.move_as_error(); } - send_closure(file_reference_manager, &FileReferenceManager::on_query_result, dest, file_source_id, - std::move(status), 0); + send_closure(actor_id, &FileReferenceManager::on_query_result, dest, file_source_id, std::move(status), 0); }); - send_closure(file_manager, &FileManager::on_file_reference_repaired, dest.node_id, file_source_id, + send_closure(file_manager_actor_id, &FileManager::on_file_reference_repaired, dest.node_id, file_source_id, std::move(result), std::move(new_promise)); }); auto index = static_cast(file_source_id.get()) - 1;