Do not allow to call toggleSupergroupIsAllHistoryAvailable for discussion supergroups.

GitOrigin-RevId: 48afc0ea0af30750bc2cfd42aa36ec48abc33244
This commit is contained in:
levlam 2019-09-13 05:51:22 +03:00
parent 2b6b498e76
commit 73162dce06

View File

@ -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<ToggleChannelIsAllHistoryAvailableQuery>(std::move(promise))