Skip to content

Commit

Permalink
Don't shrink non-photo media.
Browse files Browse the repository at this point in the history
  • Loading branch information
john-preston committed Oct 29, 2023
1 parent 04f040c commit 94ac9f9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions Telegram/SourceFiles/data/data_web_page.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,9 @@ bool WebPageData::applyChanges(
}
return QString();
}();
if (newDocument || !newCollage.items.empty() || !newPhoto) {
newHasLargeMedia = false;
}

if (type == newType
&& url == resultUrl
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ QSize WebPage::countOptimalSize() {
using Flag = MediaWebPageFlag;
if (_data->hasLargeMedia && (_flags & Flag::ForceLargeMedia)) {
_asArticle = 0;
} else if (_data->photo && (_flags & Flag::ForceSmallMedia)) {
} else if (_data->hasLargeMedia && (_flags & Flag::ForceSmallMedia)) {
_asArticle = 1;
} else {
_asArticle = _data->computeDefaultSmallMedia();
Expand Down

0 comments on commit 94ac9f9

Please sign in to comment.