From 9ee52310fbe51b13f0913c21be64f037252aa7bf Mon Sep 17 00:00:00 2001 From: levlam Date: Mon, 17 Jun 2019 04:36:27 +0300 Subject: [PATCH] Fix processing of inaccessible users. GitOrigin-RevId: dea00d3a71e4f85b44c73c6620c2edaf39bddf17 --- td/telegram/ContactsManager.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/td/telegram/ContactsManager.cpp b/td/telegram/ContactsManager.cpp index f8d8cba1..4359056d 100644 --- a/td/telegram/ContactsManager.cpp +++ b/td/telegram/ContactsManager.cpp @@ -5104,6 +5104,12 @@ void ContactsManager::on_get_user(tl_object_ptr &&user_ptr, bool have_access_hash = (flags & USER_FLAG_HAS_ACCESS_HASH) != 0; bool is_received = (flags & USER_FLAG_IS_INACCESSIBLE) == 0; + if (!is_received && !have_user_force(user_id)) { + // we must preload information about received inaccessible users from database in order to not save + // the min-user to the database and to not override access_hash and another info + LOG(INFO) << "Receive inaccessible " << user_id; + } + User *u = add_user(user_id, "on_get_user"); if (have_access_hash) { // access_hash must be updated before photo auto access_hash = user->access_hash_;