From 754b3a5ae8e0657b29580ce72901312d87cb9842 Mon Sep 17 00:00:00 2001 From: John Preston Date: Fri, 16 Aug 2024 11:16:18 +0200 Subject: [PATCH] Fix bottom text and info layout in albums. --- .../SourceFiles/history/view/history_view_message.cpp | 11 +++++------ .../SourceFiles/history/view/history_view_message.h | 2 +- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/Telegram/SourceFiles/history/view/history_view_message.cpp b/Telegram/SourceFiles/history/view/history_view_message.cpp index c0ece7602..0a4fcded4 100644 --- a/Telegram/SourceFiles/history/view/history_view_message.cpp +++ b/Telegram/SourceFiles/history/view/history_view_message.cpp @@ -831,7 +831,7 @@ QSize Message::performCountOptimalSize() { refreshReactions(); } refreshRightBadge(); - refreshInfoSkipBlock(); + refreshInfoSkipBlock(textItem); const auto botTop = item->isFakeAboutView() ? Get() @@ -4485,17 +4485,16 @@ QSize Message::performCountCurrentSize(int newWidth) { return { newWidth, newHeight }; } -void Message::refreshInfoSkipBlock() { - const auto item = data(); +void Message::refreshInfoSkipBlock(HistoryItem *textItem) { const auto media = this->media(); const auto hasTextSkipBlock = [&] { - if (item->_text.empty()) { + if (!textItem || textItem->_text.empty()) { if (const auto media = data()->media()) { return media->storyExpired(); } return false; - } else if (item->Has() - || factcheckBlock()) { + } else if (factcheckBlock() + || data()->Has()) { return false; } else if (media && media->isDisplayed() && !_invertMedia) { return false; diff --git a/Telegram/SourceFiles/history/view/history_view_message.h b/Telegram/SourceFiles/history/view/history_view_message.h index 6b8c28d48..af97b8b95 100644 --- a/Telegram/SourceFiles/history/view/history_view_message.h +++ b/Telegram/SourceFiles/history/view/history_view_message.h @@ -285,7 +285,7 @@ private: void ensureRightAction() const; void refreshTopicButton(); - void refreshInfoSkipBlock(); + void refreshInfoSkipBlock(HistoryItem *textItem); [[nodiscard]] int monospaceMaxWidth() const; void validateInlineKeyboard(HistoryMessageReplyMarkup *markup);