Provided spoiler info to notification text.

This commit is contained in:
23rd 2021-12-21 16:19:50 +03:00 committed by John Preston
parent 90dedb7b70
commit a027a02130
2 changed files with 7 additions and 4 deletions

View file

@ -534,7 +534,7 @@ bool MediaPhoto::replyPreviewLoaded() const {
QString MediaPhoto::notificationText() const { QString MediaPhoto::notificationText() const {
return WithCaptionNotificationText( return WithCaptionNotificationText(
tr::lng_in_dlg_photo(tr::now), tr::lng_in_dlg_photo(tr::now),
parent()->originalText().text); TextUtilities::TextWithSpoilerCommands(parent()->originalText()));
} }
ItemPreview MediaPhoto::toPreview(ToPreviewOptions options) const { ItemPreview MediaPhoto::toPreview(ToPreviewOptions options) const {
@ -814,7 +814,9 @@ QString MediaFile::notificationText() const {
} }
return tr::lng_in_dlg_file(tr::now); return tr::lng_in_dlg_file(tr::now);
}(); }();
return WithCaptionNotificationText(type, parent()->originalText().text); return WithCaptionNotificationText(
type,
TextUtilities::TextWithSpoilerCommands(parent()->originalText()));
} }
QString MediaFile::pinnedTextSubstring() const { QString MediaFile::pinnedTextSubstring() const {
@ -1307,7 +1309,7 @@ ItemPreview MediaWebPage::toPreview(ToPreviewOptions options) const {
} }
QString MediaWebPage::notificationText() const { QString MediaWebPage::notificationText() const {
return parent()->originalText().text; return TextUtilities::TextWithSpoilerCommands(parent()->originalText());
} }
QString MediaWebPage::pinnedTextSubstring() const { QString MediaWebPage::pinnedTextSubstring() const {

View file

@ -1022,7 +1022,8 @@ QString HistoryItem::notificationText() const {
if (_media && !isService()) { if (_media && !isService()) {
return _media->notificationText(); return _media->notificationText();
} else if (!emptyText()) { } else if (!emptyText()) {
return _text.toString(); return TextUtilities::TextWithSpoilerCommands(
_text.toTextWithEntities());
} }
return QString(); return QString();
}(); }();