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/ManagerLinux.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/notifications/ManagerLinux.cpp') diff --git a/src/notifications/ManagerLinux.cpp b/src/notifications/ManagerLinux.cpp index 202f2a9d..9bcda1b2 100644 --- a/src/notifications/ManagerLinux.cpp +++ b/src/notifications/ManagerLinux.cpp @@ -7,6 +7,7 @@ #include #include #include +#include #include #include @@ -176,9 +177,12 @@ NotificationsManager::formatNotification(const mtx::events::collections::Timelin .replace("", "") .replace("", "") .replace("", "") - .replace("", ""); + .replace("", "") + .replace(QRegularExpression("(.+\\<\\/mx-reply\\>)"), ""); - return QTextDocumentFragment::fromHtml(mtx::accessors::formattedBodyWithFallback(e)) + return QTextDocumentFragment::fromHtml( + mtx::accessors::formattedBodyWithFallback(e).replace( + QRegularExpression("(.+\\<\\/mx-reply\\>)"), "")) .toPlainText(); } -- cgit 1.5.1