From 3d1275e19a5bfe55bdf392d7657f7805adeb9fc1 Mon Sep 17 00:00:00 2001 From: John Preston Date: Mon, 13 Jan 2020 14:26:43 +0300 Subject: [PATCH] Disable forwarding public polls to channels. --- Telegram/Resources/langs/lang.strings | 2 ++ Telegram/SourceFiles/data/data_media_types.cpp | 3 +++ 2 files changed, 5 insertions(+) diff --git a/Telegram/Resources/langs/lang.strings b/Telegram/Resources/langs/lang.strings index b606a086d6..e7251931ff 100644 --- a/Telegram/Resources/langs/lang.strings +++ b/Telegram/Resources/langs/lang.strings @@ -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"; diff --git a/Telegram/SourceFiles/data/data_media_types.cpp b/Telegram/SourceFiles/data/data_media_types.cpp index 34939fb5dd..e0f6bd6f76 100644 --- a/Telegram/SourceFiles/data/data_media_types.cpp +++ b/Telegram/SourceFiles/data/data_media_types.cpp @@ -1302,6 +1302,9 @@ TextForMimeData MediaPoll::clipboardText() const { } QString MediaPoll::errorTextForForward(not_null 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