From 741501d1d9a474edfed153fc775ed245b5c14018 Mon Sep 17 00:00:00 2001 From: 23rd <23rd@vivaldi.net> Date: Fri, 29 Mar 2019 15:28:46 +0300 Subject: [PATCH] Removed sending gif attributes when edit media. - Removed handling gif for render animated preview. --- Telegram/SourceFiles/apiwrap.cpp | 5 ++--- Telegram/SourceFiles/boxes/edit_caption_box.cpp | 10 ++-------- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/Telegram/SourceFiles/apiwrap.cpp b/Telegram/SourceFiles/apiwrap.cpp index 1b88625809..46a52da5ba 100644 --- a/Telegram/SourceFiles/apiwrap.cpp +++ b/Telegram/SourceFiles/apiwrap.cpp @@ -4665,9 +4665,8 @@ void ApiWrap::editUploadedDocument( | (thumb ? MTPDinputMediaUploadedDocument::Flag::f_thumb : MTPDinputMediaUploadedDocument::Flag(0)) - | (groupId - ? MTPDinputMediaUploadedDocument::Flag::f_nosound_video - : MTPDinputMediaUploadedDocument::Flag(0)); + // Never edit video as gif. + | MTPDinputMediaUploadedDocument::Flag::f_nosound_video; const auto media = MTP_inputMediaUploadedDocument( MTP_flags(flags), file, diff --git a/Telegram/SourceFiles/boxes/edit_caption_box.cpp b/Telegram/SourceFiles/boxes/edit_caption_box.cpp index 0ce7b206b4..a8152bf2d0 100644 --- a/Telegram/SourceFiles/boxes/edit_caption_box.cpp +++ b/Telegram/SourceFiles/boxes/edit_caption_box.cpp @@ -369,7 +369,6 @@ void EditCaptionBox::createEditMediaButton() { _thumbw = _thumbh = _thumbx = 0; _gifw = _gifh = _gifx = 0; - auto isGif = false; _wayWrap->toggle(_isImage && _isNotAlbum, anim::type::instant); using Info = FileMediaInformation; @@ -379,7 +378,8 @@ void EditCaptionBox::createEditMediaButton() { } else if (const auto video = base::get_if(fileMedia)) { _animated = true; - isGif = video->isGifv; + // Never edit video as gif. + video->isGifv = false; } else { auto nameString = filename; if (const auto song = @@ -402,12 +402,6 @@ void EditCaptionBox::createEditMediaButton() { _thumbw = _thumb.width(); _thumbh = _thumb.height(); _thumbx = (st::boxWideWidth - _thumbw) / 2; - if (isGif) { - _gifw = _thumbw; - _gifh = _thumbh; - _gifx = _thumbx; - prepareGifPreview(); - } } captionResized(); }