diff --git a/Telegram/SourceFiles/history/view/history_view_element.cpp b/Telegram/SourceFiles/history/view/history_view_element.cpp index e945fd967e..b00bddf427 100644 --- a/Telegram/SourceFiles/history/view/history_view_element.cpp +++ b/Telegram/SourceFiles/history/view/history_view_element.cpp @@ -1677,6 +1677,11 @@ void Element::validateText() { return; } } + + // Albums may show text of a different item than the parent one. + // Media::itemForText may initialize data within the object. + _textItem = _media ? _media->itemForText() : item.get(); + const auto &summary = item->summaryEntry(); const auto summaryShownWas = (_flags & Flag::SummaryShown) != 0; const auto summaryShownNow = !summary.result.empty() && summary.shown; @@ -1684,7 +1689,6 @@ void Element::validateText() { if (summaryShownNow) { _flags |= Flag::SummaryShown; if (summaryShownChanged) { - _textItem = item; setTextWithLinks(summary.result); } return; @@ -1692,8 +1696,6 @@ void Element::validateText() { _flags &= ~Flag::SummaryShown; } - // Albums may show text of a different item than the parent one. - _textItem = _media ? _media->itemForText() : item.get(); if (!_textItem) { if (!_text.isEmpty()) { setTextWithLinks({});