Skip to content
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

Convert username mentions even if nickname set #208

Merged
merged 1 commit into from
Mar 29, 2017

Conversation

Throne3d
Copy link
Collaborator

@Throne3d Throne3d commented Mar 26, 2017

In Discord, using @username pings the person with the username even if they currently have their nickname set to something else. As nicknames can have non-ASCII characters in them (or rather, characters that constitute a 'boundary' per the /@[^\s]+\b/g regex to match @-mentions of usernames), and usernames don't tend to (or perhaps can't), enabling username mentions even when a nickname is set would allow IRC users to still mention users with such nicknames.

I can't immediately think of a use-case where this distinction would be useful (or expected), and as Discord itself handles it differently I don't think this is the correct behavior.

In addition, I think the test for this behavior (not creating a mention if nickname differs from username) was broken. See where 'Hello, @username!' becomes 'Hello, @testuser!' below – it wasn't in fact referencing an existent user, so this was instead testing that mentioning a nonexistent user doesn't change the mention text.

@coveralls
Copy link

coveralls commented Mar 26, 2017

Coverage Status

Coverage decreased (-0.04%) to 97.315% when pulling 8ef4ba9 on Throne3d:fix/username-mentions into 26626e5 on reactiflux:master.

@Throne3d
Copy link
Collaborator Author

(It doesn't look like I've actually made any lines uncovered by changing these tests, just that some 'tested' lines have been removed.)

@ekmartin ekmartin merged commit bc3f517 into reactiflux:master Mar 29, 2017
@ekmartin
Copy link
Member

That sounds reasonable. Thank you for a series of high quality pull requests! I've added you as a collaborator to the project. Feel free to help review PRs if you want to and have time.

@Throne3d Throne3d deleted the fix/username-mentions branch March 29, 2017 20:21
@ekmartin
Copy link
Member

ekmartin commented Apr 4, 2017

Released in 2.3.0!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants