From d3e1385b8be4f9cfc7f125b0a594728e4bfbbb90 Mon Sep 17 00:00:00 2001 From: levlam Date: Fri, 31 Dec 2021 16:21:03 +0300 Subject: [PATCH] Add some debug logging. --- td/telegram/ContactsManager.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/td/telegram/ContactsManager.cpp b/td/telegram/ContactsManager.cpp index cc1a6ed0e..8c2f2f9d4 100644 --- a/td/telegram/ContactsManager.cpp +++ b/td/telegram/ContactsManager.cpp @@ -4417,9 +4417,11 @@ bool ContactsManager::have_input_peer_user(UserId user_id, AccessRights access_r bool ContactsManager::have_input_peer_user(const User *u, AccessRights access_rights) { if (u == nullptr) { + LOG(DEBUG) << "Have no user"; return false; } if (u->access_hash == -1 || u->is_min_access_hash) { + LOG(DEBUG) << "Have user without access hash"; return false; } if (access_rights == AccessRights::Know) { @@ -4429,6 +4431,7 @@ bool ContactsManager::have_input_peer_user(const User *u, AccessRights access_ri return true; } if (u->is_deleted) { + LOG(DEBUG) << "Have a deleted user"; return false; } return true; @@ -4457,6 +4460,7 @@ bool ContactsManager::have_input_peer_chat(ChatId chat_id, AccessRights access_r bool ContactsManager::have_input_peer_chat(const Chat *c, AccessRights access_rights) { if (c == nullptr) { + LOG(DEBUG) << "Have no basic group"; return false; } if (access_rights == AccessRights::Know) { @@ -4466,9 +4470,11 @@ bool ContactsManager::have_input_peer_chat(const Chat *c, AccessRights access_ri return true; } if (c->status.is_left()) { + LOG(DEBUG) << "Have left basic group"; return false; } if (access_rights == AccessRights::Write && !c->is_active) { + LOG(DEBUG) << "Have inactive basic group"; return false; } return true; @@ -4505,6 +4511,7 @@ tl_object_ptr ContactsManager::get_input_peer_channel(C bool ContactsManager::have_input_peer_channel(const Channel *c, ChannelId channel_id, AccessRights access_rights, bool from_linked) const { if (c == nullptr) { + LOG(DEBUG) << "Have no supergroup"; return false; } if (access_rights == AccessRights::Know) { @@ -4514,6 +4521,7 @@ bool ContactsManager::have_input_peer_channel(const Channel *c, ChannelId channe return true; } if (c->status.is_banned()) { + LOG(DEBUG) << "Was banned in a supergroup"; return false; } if (c->status.is_member()) { @@ -4549,6 +4557,7 @@ bool ContactsManager::have_input_peer_channel(const Channel *c, ChannelId channe } } } + LOG(DEBUG) << "Have no access to a private supergroup"; return false; } @@ -4558,6 +4567,7 @@ bool ContactsManager::have_input_encrypted_peer(SecretChatId secret_chat_id, Acc bool ContactsManager::have_input_encrypted_peer(const SecretChat *secret_chat, AccessRights access_rights) { if (secret_chat == nullptr) { + LOG(DEBUG) << "Have no secret chat"; return false; } if (access_rights == AccessRights::Know) {