Add source to ContactsManager::load_user_full.

This commit is contained in:
levlam 2021-08-02 06:14:59 +03:00
parent 34e9dc11d6
commit d1b985430c
4 changed files with 8 additions and 8 deletions

View File

@ -9359,7 +9359,7 @@ void ContactsManager::on_load_user_full_from_database(UserId user_id, string val
if (is_user_deleted(user_id)) {
drop_user_full(user_id);
} else if (user_full->expires_at == 0.0) {
load_user_full(user_id, true, Auto());
load_user_full(user_id, true, Auto(), "on_load_user_full_from_database");
}
}
@ -11260,7 +11260,7 @@ bool ContactsManager::delete_profile_photo_from_cache(UserId user_id, int64 prof
user_full->photo = Photo();
user_full->is_changed = true;
load_user_full(user_id, true, Auto());
load_user_full(user_id, true, Auto(), "delete_profile_photo_from_cache");
}
if (send_updates) {
update_user_full(user_full, user_id);
@ -11320,7 +11320,7 @@ void ContactsManager::drop_user_photos(UserId user_id, bool is_empty, bool drop_
user_full->expires_at = 0.0;
user_full->need_save_to_database = true;
}
load_user_full(user_id, true, Auto());
load_user_full(user_id, true, Auto(), "drop_user_photos");
}
update_user_full(user_full, user_id);
}
@ -13721,7 +13721,7 @@ void ContactsManager::reload_user(UserId user_id, Promise<Unit> &&promise) {
td_->create_handler<GetUsersQuery>(std::move(promise))->send(std::move(users));
}
bool ContactsManager::load_user_full(UserId user_id, bool force, Promise<Unit> &&promise) {
bool ContactsManager::load_user_full(UserId user_id, bool force, Promise<Unit> &&promise, const char *source) {
auto u = get_user(user_id);
if (u == nullptr) {
promise.set_error(Status::Error(6, "User not found"));
@ -13736,7 +13736,7 @@ bool ContactsManager::load_user_full(UserId user_id, bool force, Promise<Unit> &
return false;
}
send_get_user_full_query(user_id, std::move(input_user), std::move(promise), "load_user_full");
send_get_user_full_query(user_id, std::move(input_user), std::move(promise), source);
return false;
}
if (user_full->is_expired()) {

View File

@ -459,7 +459,7 @@ class ContactsManager final : public Actor {
UserId get_me(Promise<Unit> &&promise);
bool get_user(UserId user_id, int left_tries, Promise<Unit> &&promise);
void reload_user(UserId user_id, Promise<Unit> &&promise);
bool load_user_full(UserId user_id, bool force, Promise<Unit> &&promise);
bool load_user_full(UserId user_id, bool force, Promise<Unit> &&promise, const char *source);
void reload_user_full(UserId user_id);
std::pair<int32, vector<const Photo *>> get_user_profile_photos(UserId user_id, int32 offset, int32 limit,

View File

@ -17063,7 +17063,7 @@ void MessagesManager::get_dialog_info_full(DialogId dialog_id, Promise<Unit> &&p
switch (dialog_id.get_type()) {
case DialogType::User:
send_closure_later(G()->contacts_manager(), &ContactsManager::load_user_full, dialog_id.get_user_id(), false,
std::move(promise));
std::move(promise), source);
return;
case DialogType::Chat:
send_closure_later(G()->contacts_manager(), &ContactsManager::load_chat_full, dialog_id.get_chat_id(), false,

View File

@ -702,7 +702,7 @@ class GetUserFullInfoRequest final : public RequestActor<> {
UserId user_id_;
void do_run(Promise<Unit> &&promise) final {
td->contacts_manager_->load_user_full(user_id_, get_tries() < 2, std::move(promise));
td->contacts_manager_->load_user_full(user_id_, get_tries() < 2, std::move(promise), "GetUserFullInfoRequest");
}
void do_send_result() final {