From 3b125ce511f762f4404208776a06d83b34f08630 Mon Sep 17 00:00:00 2001 From: levlam Date: Mon, 2 Aug 2021 06:20:59 +0300 Subject: [PATCH] Don't try to get full channel if it is inaccessible. --- td/telegram/ContactsManager.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/td/telegram/ContactsManager.cpp b/td/telegram/ContactsManager.cpp index e576584c2..0b7b59cda 100644 --- a/td/telegram/ContactsManager.cpp +++ b/td/telegram/ContactsManager.cpp @@ -14373,7 +14373,11 @@ void ContactsManager::send_get_channel_full_query(ChannelFull *channel_full, Cha Promise &&promise, const char *source) { auto input_channel = get_input_channel(channel_id); if (input_channel == nullptr) { - return promise.set_error(Status::Error(6, "Supergroup not found")); + return promise.set_error(Status::Error(400, "Supergroup not found")); + } + + if (!have_input_peer_channel(channel_id, AccessRights::Read)) { + return promise.set_error(Status::Error(400, "Can't access the chat")); } if (channel_full != nullptr) {