2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-30 22:16:14 +00:00

Disable creating public polls in channels.

This commit is contained in:
John Preston
2020-01-13 14:18:15 +03:00
parent aac6d0df27
commit d72d1aabe6
3 changed files with 23 additions and 8 deletions

View File

@@ -710,6 +710,9 @@ void PeerMenuShareContactBox(
void PeerMenuCreatePoll(not_null<PeerData*> peer) {
const auto box = Ui::show(Box<CreatePollBox>(
&peer->session(),
((peer->isChannel() && !peer->isMegagroup())
? CreatePollBox::PublicVotes::Disabled
: CreatePollBox::PublicVotes::Enabled),
Api::SendType::Normal));
const auto lock = box->lifetime().make_state<bool>(false);
box->submitRequests(