Syriiin / irc-to-discord

IRC to Discord and vise-versa chat relay
MIT License
6 stars 2 forks source link

Zero width spaces are preserved when relaying irc messages to discord #12

Open Syriiin opened 4 years ago

Syriiin commented 4 years ago

Zero width spaces are added by the bridge to the author of discord messages when relaying to irc in order to prevent unintended mention notifications for irc users who have the same username as a discord user who sends a message. It makes sense that the bridge should filter out these zero width spaces again before processing them for discord as they might be accidentally included in usernames where a discord mention is intended. eg. irc user copy pastes a discord username from the bridge's message and tries to mention the discord user by adding an @ to the beginning. No mention will occur because the zero width space was copied along with the username.

Should probably only strip zero width spaces where there would otherwise be a mention match, but it probably wont matter much if all zero width spaces are purged regardless.