Add regex to remove replies in notifications
This commit is contained in:
parent
c693d54598
commit
37acdad928
3 changed files with 16 additions and 5 deletions
|
|
@ -1,5 +1,6 @@
|
|||
#include "Manager.h"
|
||||
|
||||
#include <QRegularExpression>
|
||||
#include <QTextDocumentFragment>
|
||||
|
||||
#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>.+\\<\\/mx-reply\\>)"), ""))
|
||||
.toPlainText();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue