diff --git a/Telegram/SourceFiles/history/view/media/history_view_media_unwrapped.cpp b/Telegram/SourceFiles/history/view/media/history_view_media_unwrapped.cpp index 2b7280812b..38331c3cea 100644 --- a/Telegram/SourceFiles/history/view/media/history_view_media_unwrapped.cpp +++ b/Telegram/SourceFiles/history/view/media/history_view_media_unwrapped.cpp @@ -77,7 +77,8 @@ QSize UnwrappedMedia::countOptimalSize() { QSize UnwrappedMedia::countCurrentSize(int newWidth) { const auto item = _parent->data(); accumulate_min(newWidth, maxWidth()); - if (_parent->media() == this) { + const auto isPageAttach = (_parent->media() != this); + if (!isPageAttach) { const auto via = item->Get(); const auto reply = _parent->displayedReply(); const auto forwarded = getDisplayedForwardedInfo(); @@ -93,8 +94,9 @@ QSize UnwrappedMedia::countCurrentSize(int newWidth) { } } auto newHeight = minHeight(); - if (_parent->hasOutLayout() - && !_parent->delegate()->elementIsChatWide()) { + if (!isPageAttach + && _parent->hasOutLayout() + && !_parent->delegate()->elementIsChatWide()) { // Add some height to isolated emoji for the timestamp info. const auto infoHeight = st::msgDateImgPadding.y() * 2 + st::msgDateFont->height;