-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Conversation
/backport to stable30 |
Signed-off-by: Joas Schilling <[email protected]>
Signed-off-by: Joas Schilling <[email protected]>
52eccbc
to
b61a8cf
Compare
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]>
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.
Checklist