Merge pull request #983 from poixen/mention_fix

Mentions will now work with all legal chars
This commit is contained in:
poixen 2015-04-20 14:20:23 +02:00
commit 2902d8575e

View file

@ -247,7 +247,7 @@ void ChatView::appendMessage(QString message, QString sender, UserLevelFlags use
showSystemPopup(ref); showSystemPopup(ref);
} }
} else { } 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) if (mentionEndIndex == -1)
mentionEndIndex = message.size(); // there is no text after the mention mentionEndIndex = message.size(); // there is no text after the mention
QString userMention = message.left(mentionEndIndex); QString userMention = message.left(mentionEndIndex);