From 2d34bfeb1b705b6051fd52207346c83fef041382 Mon Sep 17 00:00:00 2001 From: Matt Lowe Date: Sat, 18 Apr 2015 14:42:39 +0200 Subject: [PATCH] Mentions will now work with all legal chars As the server has been updated to enforce username rules, we can now check for the next position of whitespace. This allows ALL users to have a working mention system. Currently "-" is available for users, this will fix that. --- cockatrice/src/chatview.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cockatrice/src/chatview.cpp b/cockatrice/src/chatview.cpp index 99da5a6c..c4b217a1 100644 --- a/cockatrice/src/chatview.cpp +++ b/cockatrice/src/chatview.cpp @@ -247,7 +247,7 @@ void ChatView::appendMessage(QString message, QString sender, UserLevelFlags use showSystemPopup(ref); } } else { - int mentionEndIndex = message.indexOf(QRegExp("\\W"), 1);// from 1 as @ is non-char + int mentionEndIndex = message.indexOf(QRegExp("\\s"), 1);// from 1 as @ is non-char if (mentionEndIndex == -1) mentionEndIndex = message.size(); // there is no text after the mention QString userMention = message.left(mentionEndIndex);