Disable forwarding public polls to channels.

This commit is contained in:
John Preston 2020-01-13 14:26:43 +03:00
parent d72d1aabe6
commit 3d1275e19a
2 changed files with 5 additions and 0 deletions

View File

@ -1797,6 +1797,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_restricted_send_inline_all" = "Posting inline content isn't allowed in this group.";
"lng_restricted_send_polls_all" = "Posting polls isn't allowed in this group.";
"lng_restricted_send_public_polls" = "Sorry, public polls can't be forwarded to channels.";
"lng_exceptions_list_title" = "Exceptions";
"lng_removed_list_title" = "Removed users";

View File

@ -1302,6 +1302,9 @@ TextForMimeData MediaPoll::clipboardText() const {
}
QString MediaPoll::errorTextForForward(not_null<PeerData*> peer) const {
if (_poll->publicVotes() && peer->isChannel() && !peer->isMegagroup()) {
return tr::lng_restricted_send_public_polls(tr::now);
}
return Data::RestrictionError(
peer,
ChatRestriction::f_send_polls