diff --git a/td/telegram/MessagesManager.cpp b/td/telegram/MessagesManager.cpp index 676f980c7..04f3cba23 100644 --- a/td/telegram/MessagesManager.cpp +++ b/td/telegram/MessagesManager.cpp @@ -19948,6 +19948,10 @@ void MessagesManager::send_get_dialog_notification_settings_query(DialogId dialo return; } + if (!have_input_peer(dialog_id, AccessRights::Read)) { + return promise.set_error(Status::Error(400, "Can't access the chat")); + } + td_->create_handler()->send(dialog_id); }