summary refs log tree commit diff
path: root/src/notifications/ManagerMac.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/notifications/ManagerMac.cpp')
-rw-r--r--src/notifications/ManagerMac.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/notifications/ManagerMac.cpp b/src/notifications/ManagerMac.cpp
index 627e9315..ee5639e4 100644
--- a/src/notifications/ManagerMac.cpp
+++ b/src/notifications/ManagerMac.cpp
@@ -4,6 +4,7 @@
 
 #include "Manager.h"
 
+#include <QCoreApplication>
 #include <QRegularExpression>
 #include <QTextDocumentFragment>
 
@@ -19,7 +20,13 @@
 static QString
 formatNotification(const mtx::responses::Notification &notification)
 {
-    return utils::stripReplyFallbacks(notification.event, {}, {}).quoted_body;
+    auto fallbacks = utils::stripReplyFallbacks(notification.event, {}, {});
+
+    bool containsSpoiler = fallbacks.quoted_formatted_body.contains("<span data-mx-spoiler");
+    if (containsSpoiler)
+        return QCoreApplication::translate("macosNotification", "Message contains spoiler.");
+    else
+        return fallbacks.quoted_body;
 }
 
 NotificationsManager::NotificationsManager(QObject *parent)