Fix creation of WEBM documents.

This commit is contained in:
levlam 2022-01-31 20:41:11 +03:00
parent e503195e0e
commit d5d6e520e0

View File

@ -5594,10 +5594,12 @@ Result<std::tuple<FileId, bool, bool, StickerFormat>> StickersManager::prepare_i
return std::make_tuple(FileId(), false, false, StickerFormat::Unknown); return std::make_tuple(FileId(), false, false, StickerFormat::Unknown);
} }
if (file_type == FileType::Sticker) { if (format == StickerFormat::Tgs) {
int32 width = for_thumbnail ? 100 : 512; int32 width = for_thumbnail ? 100 : 512;
create_sticker(file_id, string(), PhotoSize(), get_dimensions(width, width, "prepare_input_file"), nullptr, format, create_sticker(file_id, string(), PhotoSize(), get_dimensions(width, width, "prepare_input_file"), nullptr, format,
nullptr); nullptr);
} else if (format == StickerFormat::Webm) {
td_->documents_manager_->create_document(file_id, string(), PhotoSize(), "sticker.webm", "video/webm", false);
} else { } else {
td_->documents_manager_->create_document(file_id, string(), PhotoSize(), "sticker.png", "image/png", false); td_->documents_manager_->create_document(file_id, string(), PhotoSize(), "sticker.png", "image/png", false);
} }