From 5120d3ef2cc7a2f97e015f1aff950669531713e3 Mon Sep 17 00:00:00 2001 From: John Preston Date: Fri, 8 May 2020 13:35:16 +0400 Subject: [PATCH] Skip channels without write access in forward box. --- Telegram/SourceFiles/boxes/peer_list_controllers.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Telegram/SourceFiles/boxes/peer_list_controllers.cpp b/Telegram/SourceFiles/boxes/peer_list_controllers.cpp index 5fab61356..34b0c8fb3 100644 --- a/Telegram/SourceFiles/boxes/peer_list_controllers.cpp +++ b/Telegram/SourceFiles/boxes/peer_list_controllers.cpp @@ -584,5 +584,9 @@ void ChooseRecipientBoxController::rowClicked(not_null row) { auto ChooseRecipientBoxController::createRow( not_null history) -> std::unique_ptr { - return std::make_unique(history); + const auto peer = history->peer; + const auto skip = peer->isChannel() + && !peer->isMegagroup() + && !peer->canWrite(); + return skip ? nullptr : std::make_unique(history); }