From 37acdad92822c3d56026bfc425a4576152d89a4e Mon Sep 17 00:00:00 2001 From: Loren Burkholder Date: Sat, 20 Feb 2021 14:00:13 -0500 Subject: Add regex to remove replies in notifications --- src/notifications/ManagerMac.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/notifications/ManagerMac.cpp') diff --git a/src/notifications/ManagerMac.cpp b/src/notifications/ManagerMac.cpp index a74df2c7..c9678638 100644 --- a/src/notifications/ManagerMac.cpp +++ b/src/notifications/ManagerMac.cpp @@ -1,5 +1,6 @@ #include "Manager.h" +#include #include #include "EventAccessors.h" @@ -8,5 +9,8 @@ QString NotificationsManager::formatNotification(const mtx::events::collections::TimelineEvents &e) { - return QTextDocumentFragment::fromHtml(mtx::accessors::formattedBodyWithFallback(e)).toPlainText(); + return QTextDocumentFragment::fromHtml( + mtx::accessors::formattedBodyWithFallback(e).replace( + QRegularExpression("(.+\\<\\/mx-reply\\>)"), "")) + .toPlainText(); } -- cgit 1.5.1