2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 14:38:15 +00:00

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 {
return WithCaptionNotificationText(
tr::lng_in_dlg_photo(tr::now),
parent()->originalText().text);
TextUtilities::TextWithSpoilerCommands(parent()->originalText()));
}
ItemPreview MediaPhoto::toPreview(ToPreviewOptions options) const {
@@ -814,7 +814,9 @@ QString MediaFile::notificationText() const {
}
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 {
@@ -1307,7 +1309,7 @@ ItemPreview MediaWebPage::toPreview(ToPreviewOptions options) const {
}
QString MediaWebPage::notificationText() const {
return parent()->originalText().text;
return TextUtilities::TextWithSpoilerCommands(parent()->originalText());
}
QString MediaWebPage::pinnedTextSubstring() const {

View File

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