diff --git a/Telegram/Resources/langs/lang.strings b/Telegram/Resources/langs/lang.strings index 40238f567b..578a935bc7 100644 --- a/Telegram/Resources/langs/lang.strings +++ b/Telegram/Resources/langs/lang.strings @@ -5243,6 +5243,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL "lng_link_move_down" = "Move Down"; "lng_link_shrink_photo" = "Shrink Photo"; "lng_link_enlarge_photo" = "Enlarge Photo"; +"lng_link_shrink_video" = "Shrink Video"; +"lng_link_enlarge_video" = "Enlarge Video"; "lng_link_remove" = "Do Not Preview"; "lng_link_about_choose" = "Click on a link to generate its preview."; diff --git a/Telegram/SourceFiles/data/data_web_page.cpp b/Telegram/SourceFiles/data/data_web_page.cpp index d03fa7d548..2186c001f6 100644 --- a/Telegram/SourceFiles/data/data_web_page.cpp +++ b/Telegram/SourceFiles/data/data_web_page.cpp @@ -271,7 +271,10 @@ bool WebPageData::applyChanges( const auto hasSiteName = !resultSiteName.isEmpty() ? 1 : 0; const auto hasTitle = !resultTitle.isEmpty() ? 1 : 0; const auto hasDescription = !newDescription.text.isEmpty() ? 1 : 0; - if (newDocument + const auto allowLargeMediaDocument = newDocument + && newDocument->isVideoFile() + && newPhoto; + if ((!allowLargeMediaDocument && newDocument) || !newCollage.items.empty() || !newPhoto || (hasSiteName + hasTitle + hasDescription < 2)) { diff --git a/Telegram/SourceFiles/history/view/controls/history_view_draft_options.cpp b/Telegram/SourceFiles/history/view/controls/history_view_draft_options.cpp index a363e11c72..6593982d10 100644 --- a/Telegram/SourceFiles/history/view/controls/history_view_draft_options.cpp +++ b/Telegram/SourceFiles/history/view/controls/history_view_draft_options.cpp @@ -899,11 +899,17 @@ void DraftOptionsBox( const auto small = state->webpage.forceSmallMedia || (!state->webpage.forceLargeMedia && state->preview->computeDefaultSmallMedia()); + const auto hasVideo = state->preview->document + && state->preview->document->isVideoFile(); Settings::AddButtonWithIcon( bottom, (small - ? tr::lng_link_enlarge_photo() - : tr::lng_link_shrink_photo()), + ? (hasVideo + ? tr::lng_link_enlarge_video() + : tr::lng_link_enlarge_photo()) + : (hasVideo + ? tr::lng_link_shrink_video() + : tr::lng_link_shrink_photo())), st::settingsButton, { small ? &st::menuIconEnlarge : &st::menuIconShrink } )->setClickedCallback([=] {