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.
This commit is contained in:
parent
739ca6a02e
commit
78edb8c661
1 changed files with 1 additions and 1 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue