-
Notifications
You must be signed in to change notification settings - Fork 45
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
Add ZWSP between Telegram usernames #322
Conversation
…ross platforms. ResolveUserName is now used instead of user.String() for retrieving username information. For additional details, see: 42wim/matterbridge#175.
Helper methods now better reflect their actions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good overall, I just had one small change but I'm not going to block on it. I didn't test the functionality of this (because I don't actively use both platforms) but it looks good from a code perspective and the tests pass.
@@ -28,6 +28,7 @@ type IRCSettings struct { | |||
Suffix string `env:"IRC_SUFFIX" envDefault:">"` | |||
ShowJoinMessage bool `env:"IRC_SHOW_JOIN_MESSAGE" envDefault:"true"` | |||
ShowLeaveMessage bool `env:"IRC_SHOW_LEAVE_MESSAGE" envDefault:"true"` | |||
ShowZWSP bool `env:"IRC_SHOW_ZWSP" envDefault:"true"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: This needs to go into the env.example
and our config glossary too.
What This Is
If a user has accounts on both IRC and Telegram with the same username, it is easy to ping oneself across platforms each time a message is sent. A zero-width space (ZWSP) is used to add an invisible differentiation between the usernames on these platforms to prevent cross-platform username pinging.
Developer Details
ResolveUserName
is now used instead ofuser.String()
for retrieving username information.For additional details, see: 42wim/matterbridge#175.