mirror of
https://github.com/vale981/tdesktop
synced 2025-03-05 17:51:41 -05:00
Fix local thumbnail saving for stickers.
This commit is contained in:
parent
10ee81f466
commit
d479442a63
1 changed files with 7 additions and 2 deletions
|
@ -2328,15 +2328,20 @@ not_null<DocumentData*> Session::processDocument(
|
||||||
|
|
||||||
case mtpc_document: {
|
case mtpc_document: {
|
||||||
const auto &fields = data.c_document();
|
const auto &fields = data.c_document();
|
||||||
|
const auto mime = qs(fields.vmime_type);
|
||||||
|
const auto format = (mime == qstr("image/webp")
|
||||||
|
|| mime == qstr("application/x-tgsticker"))
|
||||||
|
? "WEBP"
|
||||||
|
: "JPG";
|
||||||
return document(
|
return document(
|
||||||
fields.vid.v,
|
fields.vid.v,
|
||||||
fields.vaccess_hash.v,
|
fields.vaccess_hash.v,
|
||||||
fields.vfile_reference.v,
|
fields.vfile_reference.v,
|
||||||
fields.vdate.v,
|
fields.vdate.v,
|
||||||
fields.vattributes.v,
|
fields.vattributes.v,
|
||||||
qs(fields.vmime_type),
|
mime,
|
||||||
ImagePtr(),
|
ImagePtr(),
|
||||||
Images::Create(std::move(thumb), "JPG"),
|
Images::Create(std::move(thumb), format),
|
||||||
fields.vdc_id.v,
|
fields.vdc_id.v,
|
||||||
fields.vsize.v,
|
fields.vsize.v,
|
||||||
StorageImageLocation());
|
StorageImageLocation());
|
||||||
|
|
Loading…
Add table
Reference in a new issue