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:
Hafiz
2025-08-07 13:37:45 -05:00
parent 84bc8ad08f
commit 4e4bd4714e
@@ -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;