From 73162dce06612325b0ed9458b19e537350b96d95 Mon Sep 17 00:00:00 2001 From: levlam Date: Fri, 13 Sep 2019 05:51:22 +0300 Subject: [PATCH] Do not allow to call toggleSupergroupIsAllHistoryAvailable for discussion supergroups. GitOrigin-RevId: 48afc0ea0af30750bc2cfd42aa36ec48abc33244 --- td/telegram/ContactsManager.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/td/telegram/ContactsManager.cpp b/td/telegram/ContactsManager.cpp index af47bba3a..f2ecaee86 100644 --- a/td/telegram/ContactsManager.cpp +++ b/td/telegram/ContactsManager.cpp @@ -4235,7 +4235,10 @@ void ContactsManager::toggle_channel_is_all_history_available(ChannelId channel_ return promise.set_error(Status::Error(6, "Not enough rights to toggle all supergroup history availability")); } if (get_channel_type(c) != ChannelType::Megagroup) { - return promise.set_error(Status::Error(6, "Message history can be hidden in the supergroups only")); + return promise.set_error(Status::Error(6, "Message history can be hidden in supergroups only")); + } + if (c->has_linked_channel) { + return promise.set_error(Status::Error(6, "Message history can't be hidden in discussion supergroups")); } td_->create_handler(std::move(promise))