From aab4ac85269c6b41dc0b1c9773e4d7c4a1325d02 Mon Sep 17 00:00:00 2001 From: John Preston Date: Fri, 3 Nov 2023 09:38:43 +0400 Subject: [PATCH] Fix story replies. --- .../SourceFiles/history/history_item_components.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/Telegram/SourceFiles/history/history_item_components.cpp b/Telegram/SourceFiles/history/history_item_components.cpp index 758590db90..5ae8652af2 100644 --- a/Telegram/SourceFiles/history/history_item_components.cpp +++ b/Telegram/SourceFiles/history/history_item_components.cpp @@ -537,7 +537,7 @@ bool HistoryMessageReply::updateData( const auto displaying = resolvedMessage || resolvedStory - || (external && (!_fields.messageId || force)); + || (!_fields.quote.empty() && (!_fields.messageId || force)); _displaying = displaying ? 1 : 0; const auto unavailable = !resolvedMessage @@ -581,7 +581,7 @@ bool HistoryMessageReply::updateData( } return resolvedMessage || resolvedStory - || (external && !_fields.messageId) + || (external && !_fields.messageId && !_fields.storyId) || _unavailable; } @@ -1086,7 +1086,7 @@ void HistoryMessageReply::paint( + st::historyReplyPadding.top() + (st::msgServiceNameFont->height * (_nameTwoLines ? 2 : 1)); if (w > st::historyReplyPadding.left()) { - if (resolvedMessage || resolvedStory || !_text.isEmpty()) { + if (_displaying) { const auto media = resolvedMessage ? resolvedMessage->media() : nullptr; if (hasPreview) { const auto image = media @@ -1187,11 +1187,13 @@ void HistoryMessageReply::paint( p.setPen(cache->icon); p.drawTextLeft( textLeft, - y + st::historyReplyPadding.top() + (st::msgDateFont->height / 2), + (y + + st::historyReplyPadding.top() + + (st::msgDateFont->height / 2)), w + 2 * x, st::msgDateFont->elided( statePhrase(), - w - textLeft - st::historyReplyPadding.right())); + x + w - textLeft - st::historyReplyPadding.right())); } } }