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

Mention sub name users #5041

Merged
merged 3 commits into from
Jan 29, 2021
Merged

Conversation

nickvergessen
Copy link
Member

Steps

  1. Post message Mention to @sub and @subname
  2. Post message Mention to @subname and @sub
Before After
Bildschirmfoto von 2021-01-28 16-03-05 Bildschirmfoto von 2021-01-28 16-02-52

@nickvergessen
Copy link
Member Author

/backport to stable20.1

@nickvergessen
Copy link
Member Author

/backport to stable20

lib/Chat/Parser/UserMention.php Outdated Show resolved Hide resolved
Copy link
Member

@danxuliu danxuliu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using \b (word boundary)) does not cover all the valid characters in a user name. I have added unit tests that show the issue.

@nickvergessen
Copy link
Member Author

Then I guess we should indeed sort by length first, because Hi @sub. is more likely than 2 users sub and sub.name and will get quite complexe to match otherwise.

Copy link
Member

@danxuliu danxuliu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests pass and code looks good.

Allowing quotes also for user names without spaces should be fine, so 👍

nickvergessen and others added 3 commits January 29, 2021 11:15
Signed-off-by: Joas Schilling <coding@schilljs.com>
Signed-off-by: Joas Schilling <coding@schilljs.com>
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
@nickvergessen nickvergessen force-pushed the bugfix/noid/mention-sub-name-users branch from a08d0f9 to e65fa8d Compare January 29, 2021 10:15
@nickvergessen
Copy link
Member Author

Fixing up

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

Successfully merging this pull request may close these issues.

3 participants