Revert "Fix crash in imported messages in search."
This reverts commit 65d96c0364
.
This commit is contained in:
parent
5e3b094e86
commit
9bc9547b1c
|
@ -982,13 +982,13 @@ ItemPreview HistoryItem::toPreview(ToPreviewOptions options) const {
|
||||||
};
|
};
|
||||||
if (options.hideSender || isPost() || isEmpty()) {
|
if (options.hideSender || isPost() || isEmpty()) {
|
||||||
return {};
|
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<HistoryMessageForwarded>()) {
|
if (const auto forwarded = Get<HistoryMessageForwarded>()) {
|
||||||
return forwarded->originalSender
|
return forwarded->originalSender
|
||||||
? fromSender(forwarded->originalSender)
|
? fromSender(forwarded->originalSender)
|
||||||
: forwarded->hiddenSenderInfo->name;
|
: forwarded->hiddenSenderInfo->name;
|
||||||
} else if (!_history->peer->isUser()) {
|
|
||||||
return fromSender(displayFrom());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return {};
|
return {};
|
||||||
|
|
Loading…
Reference in New Issue