mirror of
https://github.com/duckietm/Nitro-V3.git
synced 2026-06-20 07:26:19 +00:00
feat(mentions): @ autocomplete, blue @nick, avatar notification toast
- Chat input @ autocomplete: typing @ shows online users (room users + online friends + room aliases) with avatars; arrows/Tab/Enter to pick. - Any valid @nick token is highlighted blue in chat bubbles (like @all), giving visual feedback that it is a recognised mention. - Side notification toast on a received mention: sender avatar (from the new senderFigure wire field) + message + dismiss; dismiss marks it read so the toolbar unread badge updates. Auto-hides after 8s. - IMentionEntry/parsers carry senderFigure end to end.
This commit is contained in:
@@ -51,9 +51,14 @@ const isMentionToken = (token: string, ownUsernameLower: string, aliases: Readon
|
||||
|
||||
if(!nick) return false;
|
||||
|
||||
// Own nick and room-broadcast aliases always count.
|
||||
if(ownUsernameLower && nick === ownUsernameLower) return true;
|
||||
if(aliases.has(nick)) return true;
|
||||
|
||||
return aliases.has(nick);
|
||||
// Any other valid @nick token is also highlighted (blue), so a direct
|
||||
// @username mention reads the same as @all — visual feedback that it is a
|
||||
// recognised mention. (Cosmetic only; the server decides actual delivery.)
|
||||
return true;
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user