diff --git a/Telegram/SourceFiles/history/view/history_view_message.cpp b/Telegram/SourceFiles/history/view/history_view_message.cpp index 345ecf9543..c0ece7602e 100644 --- a/Telegram/SourceFiles/history/view/history_view_message.cpp +++ b/Telegram/SourceFiles/history/view/history_view_message.cpp @@ -4232,13 +4232,28 @@ int Message::resizeContentGetHeight(int newWidth) { return height(); } + const auto item = data(); + const auto postShowingAuthor = item->isPostShowingAuthor() ? 1 : 0; + if (_postShowingAuthor != postShowingAuthor) { + _postShowingAuthor = postShowingAuthor; + _fromNameVersion = -1; + previousInBlocksChanged(); + + const auto size = _bottomInfo.currentSize(); + _bottomInfo.update(BottomInfoDataFromMessage(this), newWidth); + if (size != _bottomInfo.currentSize()) { + // maxWidth may have changed, full recount required. + setPendingResize(); + return resizeGetHeight(newWidth); + } + } + auto newHeight = minHeight(); if (const auto service = Get()) { service->resizeToWidth(newWidth, delegate()->elementIsChatWide()); } - const auto item = data(); const auto botTop = item->isFakeAboutView() ? Get() : nullptr; @@ -4246,14 +4261,6 @@ int Message::resizeContentGetHeight(int newWidth) { const auto mediaDisplayed = media ? media->isDisplayed() : false; const auto bubble = drawBubble(); - const auto postShowingAuthor = item->isPostShowingAuthor() ? 1 : 0; - if (_postShowingAuthor != postShowingAuthor) { - _postShowingAuthor = postShowingAuthor; - _bottomInfo.update(BottomInfoDataFromMessage(this), newWidth); - _fromNameVersion = -1; - previousInBlocksChanged(); - } - item->resolveDependent(); // This code duplicates countGeometry() but also resizes media.