Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Insert zero-width space in Telegram usernames sent to IRC #112
Inspired by 42wim/matterbridge#175.
Insert zero-width space in Telegram usernames sent to IRC to prevent pinging IRC usernames with the same Telegram nick
If someone is on both sides of a bridged Telegram group and IRC channel, and has the same username, they will get pinged on IRC whenever they send a message from Telegram. This can be annoying for IRC users when chatting from Telegram.
One solution is to insert a zero-width character into the Telegram username field sent to IRC. This prevents pinging IRC users when they chat from Telegram.
I think the space needs to be inserted after the first character or before the last. Maybe the easiest solution is to insert it after the first character of the Telegram username.
This space should only be inserted in a username relayed from Telegram to IRC.
Better user experience for people chatting on both sides of a bridge when their Telegram username and IRC nick are the same
We might want to add a way to disable this if a user doesn't want it. There is no globally accepted standard for the character encoding according to Wikipedia. Zero-width space appears to be unicode, but there may be IRC servers out there that only support ASCII.
I can't imagine there are many modern IRC servers out there that don't support Unicode (FreeNode appears to since it can send Emojis), but you never know I suppose...
Discussed in 2019-02-02 RITlug developers' meeting. This issue is targeted for the v1.3 milestone, estimated to release on March 2nd, 2019.
I went ahead and implemented a ZWP in the middle of nicks. It looks like this:
Adding a ZWP essentially breaks all our unit tests that include a username. This will take some time to look through. This raises further questions: