-
-
Notifications
You must be signed in to change notification settings - Fork 4k
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
feat(comments): Support mentioning emails #48760
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
nickvergessen
added
enhancement
3. to review
Waiting for reviews
feature: comments
labels
Oct 17, 2024
/backport to stable30 |
28 tasks
SystemKeeper
approved these changes
Oct 17, 2024
Signed-off-by: Joas Schilling <[email protected]>
Signed-off-by: Joas Schilling <[email protected]>
nickvergessen
force-pushed
the
feat/noid/support-email-mentions
branch
from
October 17, 2024 12:28
52eccbc
to
b61a8cf
Compare
danxuliu
reviewed
Oct 17, 2024
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, but please add a test in
server/tests/lib/Comments/CommentTest.php
Lines 141 to 200 in 49dd79e
public function mentionsProvider(): array { | |
return [ | |
[ | |
'@alice @bob look look, a cook!', | |
[['type' => 'user', 'id' => 'alice'], ['type' => 'user', 'id' => 'bob']], | |
], | |
[ | |
'no mentions in this message', | |
[] | |
], | |
[ | |
'@alice @bob look look, a duplication @alice test @bob!', | |
[['type' => 'user', 'id' => 'alice'], ['type' => 'user', 'id' => 'bob']], | |
], | |
[ | |
'@alice is the author, notify @bob, nevertheless mention her!', | |
[['type' => 'user', 'id' => 'alice'], ['type' => 'user', 'id' => 'bob']], | |
/* author: */ 'alice' | |
], | |
[ | |
'@foobar and @barfoo you should know, @[email protected] is valid' . | |
' and so is @[email protected]@foobar.io I hope that clarifies everything.' . | |
' cc @23452-4333-54353-2342 @yolo!' . | |
' however the most important thing to know is that www.croissant.com/@oil is not valid' . | |
' and won\'t match anything at all', | |
[ | |
['type' => 'user', 'id' => '[email protected]@foobar.io'], | |
['type' => 'user', 'id' => '23452-4333-54353-2342'], | |
['type' => 'user', 'id' => '[email protected]'], | |
['type' => 'user', 'id' => 'foobar'], | |
['type' => 'user', 'id' => 'barfoo'], | |
['type' => 'user', 'id' => 'yolo'], | |
], | |
], | |
[ | |
'@@chef is also a valid mention, no matter how strange it looks', | |
[['type' => 'user', 'id' => '@chef']], | |
], | |
[ | |
'Also @"user with spaces" are now supported', | |
[['type' => 'user', 'id' => 'user with spaces']], | |
], | |
[ | |
'Also @"guest/0123456789abcdef" are now supported', | |
[['type' => 'guest', 'id' => 'guest/0123456789abcdef']], | |
], | |
[ | |
'Also @"group/My Group ID 321" are now supported', | |
[['type' => 'group', 'id' => 'My Group ID 321']], | |
], | |
[ | |
'Welcome federation @"federated_group/My Group ID 321" @"federated_team/Former Cirle" @"federated_user/cloudId@http://example.tld:8080/nextcloud"! Now freshly supported', | |
[ | |
['type' => 'federated_user', 'id' => 'cloudId@http://example.tld:8080/nextcloud'], | |
['type' => 'federated_group', 'id' => 'My Group ID 321'], | |
['type' => 'federated_team', 'id' => 'Former Cirle'], | |
], | |
], | |
]; | |
} |
Signed-off-by: Joas Schilling <[email protected]>
danxuliu
approved these changes
Oct 18, 2024
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.
Thanks!
CI failures should be unrelated.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Checklist