From 23803223bf94e7685f43e795aecccb9fb0107844 Mon Sep 17 00:00:00 2001 From: Tobias Fella Date: Wed, 16 Apr 2025 22:11:34 +0200 Subject: [PATCH] Remove duplicate mxid regex --- src/libneochat/models/actionsmodel.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libneochat/models/actionsmodel.cpp b/src/libneochat/models/actionsmodel.cpp index 02e16f71d..0ca72a7f8 100644 --- a/src/libneochat/models/actionsmodel.cpp +++ b/src/libneochat/models/actionsmodel.cpp @@ -7,6 +7,7 @@ #include "enums/messagetype.h" #include "neochatconnection.h" #include "neochatroom.h" +#include "utils.h" #include #include #include @@ -182,8 +183,7 @@ QList actions{ Action{ u"invite"_s, [](const QString &text, NeoChatRoom *room, ChatBarCache *) { - static const QRegularExpression mxidRegex(uR"((^|[][[:space:](){}`'";])([!#@][-a-z0-9_=#/.]{1,252}:\w(?:\w|\.|-)*\.\w+(?::\d{1,5})?))"_s); - auto regexMatch = mxidRegex.match(text); + auto regexMatch = TextRegex::mxId.match(text); if (!regexMatch.hasMatch()) { Q_EMIT room->showMessage(MessageType::Error, i18nc("'' does not look like a matrix id.", "'%1' does not look like a matrix id.", text)); return QString();