From 9bc9547b1c577614408a5f16fdb78b4485ab2157 Mon Sep 17 00:00:00 2001 From: John Preston Date: Tue, 23 Nov 2021 15:33:53 +0400 Subject: [PATCH] Revert "Fix crash in imported messages in search." This reverts commit 65d96c0364532d0afd302a621943d8f745064497. --- Telegram/SourceFiles/history/history_item.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Telegram/SourceFiles/history/history_item.cpp b/Telegram/SourceFiles/history/history_item.cpp index 58355a8c1..0ad52d455 100644 --- a/Telegram/SourceFiles/history/history_item.cpp +++ b/Telegram/SourceFiles/history/history_item.cpp @@ -982,13 +982,13 @@ ItemPreview HistoryItem::toPreview(ToPreviewOptions options) const { }; if (options.hideSender || isPost() || isEmpty()) { return {}; - } else if (!_history->peer->isUser() || _history->peer->isSelf()) { + } else if (!_history->peer->isUser()) { + return fromSender(displayFrom()); + } else if (_history->peer->isSelf()) { if (const auto forwarded = Get()) { return forwarded->originalSender ? fromSender(forwarded->originalSender) : forwarded->hiddenSenderInfo->name; - } else if (!_history->peer->isUser()) { - return fromSender(displayFrom()); } } return {};