From 78edb8c6614889bc3df7fc3eb1396bb8ec0138ad Mon Sep 17 00:00:00 2001 From: Matt Lowe Date: Wed, 28 Jan 2015 13:27:45 +0100 Subject: [PATCH] Check for non-characters now checks for non characters, so a mention s like "@username!" will now work. Requires some testing though, there are a lot of scenarios to check for. --- 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 ff36a091..ba767e18 100644 --- a/cockatrice/src/chatview.cpp +++ b/cockatrice/src/chatview.cpp @@ -199,7 +199,7 @@ void ChatView::appendMessage(QString message, QString sender, UserLevelFlags use } // another user has been mentioned else { - int mentionEndIndex = message.indexOf(" "); + int mentionEndIndex = message.indexOf(QRegExp("\\W"), 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);