Fix story replies.

This commit is contained in:
John Preston 2023-11-03 09:38:43 +04:00
parent 5c98406e1a
commit aab4ac8526

View file

@ -537,7 +537,7 @@ bool HistoryMessageReply::updateData(
const auto displaying = resolvedMessage const auto displaying = resolvedMessage
|| resolvedStory || resolvedStory
|| (external && (!_fields.messageId || force)); || (!_fields.quote.empty() && (!_fields.messageId || force));
_displaying = displaying ? 1 : 0; _displaying = displaying ? 1 : 0;
const auto unavailable = !resolvedMessage const auto unavailable = !resolvedMessage
@ -581,7 +581,7 @@ bool HistoryMessageReply::updateData(
} }
return resolvedMessage return resolvedMessage
|| resolvedStory || resolvedStory
|| (external && !_fields.messageId) || (external && !_fields.messageId && !_fields.storyId)
|| _unavailable; || _unavailable;
} }
@ -1086,7 +1086,7 @@ void HistoryMessageReply::paint(
+ st::historyReplyPadding.top() + st::historyReplyPadding.top()
+ (st::msgServiceNameFont->height * (_nameTwoLines ? 2 : 1)); + (st::msgServiceNameFont->height * (_nameTwoLines ? 2 : 1));
if (w > st::historyReplyPadding.left()) { if (w > st::historyReplyPadding.left()) {
if (resolvedMessage || resolvedStory || !_text.isEmpty()) { if (_displaying) {
const auto media = resolvedMessage ? resolvedMessage->media() : nullptr; const auto media = resolvedMessage ? resolvedMessage->media() : nullptr;
if (hasPreview) { if (hasPreview) {
const auto image = media const auto image = media
@ -1187,11 +1187,13 @@ void HistoryMessageReply::paint(
p.setPen(cache->icon); p.setPen(cache->icon);
p.drawTextLeft( p.drawTextLeft(
textLeft, textLeft,
y + st::historyReplyPadding.top() + (st::msgDateFont->height / 2), (y
+ st::historyReplyPadding.top()
+ (st::msgDateFont->height / 2)),
w + 2 * x, w + 2 * x,
st::msgDateFont->elided( st::msgDateFont->elided(
statePhrase(), statePhrase(),
w - textLeft - st::historyReplyPadding.right())); x + w - textLeft - st::historyReplyPadding.right()));
} }
} }
} }