New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Insert zero-width space in Telegram usernames sent to IRC #112

Open
jwflory opened this Issue Jan 7, 2019 · 4 comments

Comments

@jwflory
Copy link
Member

jwflory commented Jan 7, 2019

Inspired by 42wim/matterbridge#175.


Summary

Insert zero-width space in Telegram usernames sent to IRC to prevent pinging IRC usernames with the same Telegram nick

Background

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.

Details

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.

Outcome

Better user experience for people chatting on both sides of a bridge when their Telegram username and IRC nick are the same

@xforever1313

This comment has been minimized.

Copy link
Contributor

xforever1313 commented Jan 7, 2019

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...

@nic-hartley

This comment has been minimized.

Copy link

nic-hartley commented Feb 2, 2019

Using square brackets around usernames instead of angle brackets should fix this -- []{}|\ are all considered part of the nickname, so [some-nick] shouldn't ping someone nick'd some-nick.

@jwflory

This comment has been minimized.

Copy link
Member Author

jwflory commented Feb 2, 2019

Discussed in 2019-02-02 RITlug developers' meeting. This issue is targeted for the v1.3 milestone, estimated to release on March 2nd, 2019.


@Tjzabel volunteered to take this one on for the v1.3 development sprint. It may happen later in the sprint cycle (after #115?). We'll follow up at the next developers' meeting on Saturday, Feb. 9th.

@Tjzabel

This comment has been minimized.

Copy link
Member

Tjzabel commented Feb 22, 2019

Update

I went ahead and implemented a ZWP in the middle of nicks. It looks like this:

from.username = from.username.substr(0,1) + "\u200B" + from.username.substr(1);

Further considerations

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:

  1. Do we want this toggleable?
  2. Will the implementation of "\u200B" as the ZWP break any IRC servers/handlers?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment