Disallow copying of Giveaway messages.

This commit is contained in:
levlam 2023-10-14 22:04:47 +03:00
parent cae7ba79ed
commit 294538ec5b

View File

@ -5349,7 +5349,7 @@ unique_ptr<MessageContent> dup_message_content(Td *td, DialogId dialog_id, const
case MessageContentType::Game: case MessageContentType::Game:
return make_unique<MessageGame>(*static_cast<const MessageGame *>(content)); return make_unique<MessageGame>(*static_cast<const MessageGame *>(content));
case MessageContentType::Giveaway: case MessageContentType::Giveaway:
if (type != MessageContentDupType::Forward && type != MessageContentDupType::ServerCopy) { if (type != MessageContentDupType::Forward) {
return nullptr; return nullptr;
} }
return make_unique<MessageGiveaway>(*static_cast<const MessageGiveaway *>(content)); return make_unique<MessageGiveaway>(*static_cast<const MessageGiveaway *>(content));