Disallow forwarding of local polls.

GitOrigin-RevId: a83397233c86ff791eda2c1cd39be77ee8488307
This commit is contained in:
levlam 2019-02-25 19:19:01 +03:00
parent 35d3be72f3
commit 40ae8b9fd5

View File

@ -2340,6 +2340,10 @@ bool can_forward_message_content(const MessageContent *content) {
auto *text = static_cast<const MessageText *>(content);
return !is_empty_string(text->text.text); // text can't be empty in the new message
}
if (content_type == MessageContentType::Poll) {
auto *poll = static_cast<const MessagePoll *>(content);
return !PollManager::is_local_poll_id(poll->poll_id);
}
return !is_service_message_content(content_type) && content_type != MessageContentType::Unsupported &&
content_type != MessageContentType::ExpiredPhoto && content_type != MessageContentType::ExpiredVideo;