Prevent false mention highlights
Prevent false mention highlights when a user's display name matches another user's username. The purple mention indicator now only appears for actual @username mentions.
This commit is contained in:
@@ -460,9 +460,8 @@ export default {
|
||||
}
|
||||
|
||||
const { user } = this;
|
||||
const displayName = user.profile.name;
|
||||
const { username } = user.auth.local;
|
||||
const pattern = `@(${escapeRegExp(displayName)}|${escapeRegExp(username)})(\\b)`;
|
||||
const pattern = `@${escapeRegExp(username)}(\\b)`;
|
||||
message.highlight = new RegExp(pattern, 'i').test(message.text);
|
||||
|
||||
return message.highlight;
|
||||
|
||||
Reference in New Issue
Block a user