From 65d96c0364532d0afd302a621943d8f745064497 Mon Sep 17 00:00:00 2001 From: John Preston Date: Mon, 1 Nov 2021 13:03:28 +0400 Subject: [PATCH] Fix crash in imported messages in search. --- 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 0a2004aba..40a82f879 100644 --- a/Telegram/SourceFiles/history/history_item.cpp +++ b/Telegram/SourceFiles/history/history_item.cpp @@ -960,13 +960,13 @@ ItemPreview HistoryItem::toPreview(ToPreviewOptions options) const { }; if (options.hideSender || isPost() || isEmpty()) { return {}; - } else if (!_history->peer->isUser()) { - return fromSender(displayFrom()); - } else if (_history->peer->isSelf()) { + } else if (!_history->peer->isUser() || _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 {};