From a027a02130ec0a6048014b1b6a9628ba360bb614 Mon Sep 17 00:00:00 2001 From: 23rd <23rd@vivaldi.net> Date: Tue, 21 Dec 2021 16:19:50 +0300 Subject: [PATCH] Provided spoiler info to notification text. --- Telegram/SourceFiles/data/data_media_types.cpp | 8 +++++--- Telegram/SourceFiles/history/history_item.cpp | 3 ++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Telegram/SourceFiles/data/data_media_types.cpp b/Telegram/SourceFiles/data/data_media_types.cpp index 0c8120498..96204825e 100644 --- a/Telegram/SourceFiles/data/data_media_types.cpp +++ b/Telegram/SourceFiles/data/data_media_types.cpp @@ -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 { diff --git a/Telegram/SourceFiles/history/history_item.cpp b/Telegram/SourceFiles/history/history_item.cpp index a3675ec9b..eb36caf03 100644 --- a/Telegram/SourceFiles/history/history_item.cpp +++ b/Telegram/SourceFiles/history/history_item.cpp @@ -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(); }();