Commit Graph

51 Commits

Author SHA1 Message Date
Joas Schilling
367be7c55f
Allow reactions also with other combined emojis
Honerful copying the EmojiService from UserStatus for now
I think this should be put into a decent place and then reused,
but I couldn't find somethin short term before beta1

Signed-off-by: Joas Schilling <coding@schilljs.com>
2022-03-24 15:13:09 +01:00
Vitor Mattos
8ec7c5c8ae
Update ICommentsManager with reaction methods
Fix psalm errors
Reorder methods and remove return null
Use best pattern on docblock

Goals: update https://github.com/ChristophWurst/nextcloud_composer/ with reaction methods.
The script
https://github.com/ChristophWurst/nextcloud_composer/blob/master/build.sh
only get lib/public classes

Signed-off-by: Vitor Mattos <vitor@php.rio>
2022-02-03 12:52:18 -03:00
Joas Schilling
e8c66d0f89
Merge pull request #30794 from nextcloud/techdebt/noid/allow-to-get-comments-with-verb
Allow to get comments with a given set of verbs
2022-01-28 16:41:42 +01:00
Joas Schilling
429380337f
Fix fake manager
Signed-off-by: Joas Schilling <coding@schilljs.com>
2022-01-21 14:02:34 +01:00
Vitor Mattos
7bb01b6ccc
Refactor and fixes on tests
Signed-off-by: Vitor Mattos <vitor@php.rio>
2022-01-21 08:40:29 -03:00
Vitor Mattos
b9f74584a1
Fix check after change from string to mb_string
Signed-off-by: Vitor Mattos <vitor@php.rio>
2022-01-21 08:39:41 -03:00
Joas Schilling
189f9f96ce
Limit the summary and sort it afterwards
Signed-off-by: Joas Schilling <coding@schilljs.com>
2022-01-21 08:39:39 -03:00
Vitor Mattos
f7cd995612
Order the reaction summary, improvements on validations
Signed-off-by: Vitor Mattos <vitor@php.rio>
2022-01-21 08:39:39 -03:00
Vitor Mattos
1ce894a50c
Disable reactions if database don't support utf8mb4
Fix column size

Signed-off-by: Vitor Mattos <vitor@php.rio>
2022-01-21 08:39:37 -03:00
Vitor Mattos
52affa9ddd
Skip if dont support 4 bytes UTF8
Signed-off-by: Vitor Mattos <vitor@php.rio>
2022-01-21 08:37:07 -03:00
Vitor Mattos
425b5cf081
Add unit tests
Signed-off-by: Vitor Mattos <vitor@php.rio>
2022-01-21 08:37:06 -03:00
Joas Schilling
03abaaaee5
Fix unit tests
Signed-off-by: Joas Schilling <coding@schilljs.com>
2022-01-05 11:53:33 +01:00
Joas Schilling
3487aeeb1f
Add integration tests for group
Signed-off-by: Joas Schilling <coding@schilljs.com>
2021-10-12 14:05:38 +02:00
Joas Schilling
86109f77e0 Fix unit tests
Signed-off-by: Joas Schilling <coding@schilljs.com>
2021-02-06 13:07:06 +01:00
Joas Schilling
ede7510854
Add a function to get the unread count for multiple objects in one go
Signed-off-by: Joas Schilling <coding@schilljs.com>
2020-11-04 11:01:21 +01:00
Joas Schilling
1f1244fdcc
Fix PHP CS
Signed-off-by: Joas Schilling <coding@schilljs.com>
2020-10-22 11:00:54 +02:00
Joas Schilling
8600e51df5
Fix manager creation and testing
Signed-off-by: Joas Schilling <coding@schilljs.com>
2020-10-22 10:54:03 +02:00
John Molakvoæ (skjnldsv)
3e1916080a
Add ICommentsManager::load method
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
2020-10-20 14:39:28 +02:00
Morris Jobke
234b510652
Change PHPDoc type hint from PHPUnit_Framework_MockObject_MockObject to \PHPUnit\Framework\MockObject\MockObject
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2020-08-12 13:55:19 +02:00
Christoph Wurst
caff1023ea
Format control structures, classes, methods and function
To continue this formatting madness, here's a tiny patch that adds
unified formatting for control structures like if and loops as well as
classes, their methods and anonymous functions. This basically forces
the constructs to start on the same line. This is not exactly what PSR2
wants, but I think we can have a few exceptions with "our" style. The
starting of braces on the same line is pracrically standard for our
code.

This also removes and empty lines from method/function bodies at the
beginning and end.

Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-04-10 14:19:56 +02:00
Christoph Wurst
14c996d982
Use elseif instead of else if
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-04-10 10:35:09 +02:00
Christoph Wurst
afbd9c4e6e
Unify function spacing to PSR2 recommendation
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-04-09 13:54:22 +02:00
Christoph Wurst
41b5e5923a
Use exactly one empty line after the namespace declaration
For PSR2

Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-04-09 11:48:10 +02:00
Christoph Wurst
2ee65f177e
Use the shorter phpunit syntax for mocked return values
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-03-25 22:21:27 +01:00
Roeland Jago Douma
3a7cf40aaa
Mode to modern phpunit
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2019-11-27 15:27:18 +01:00
Roeland Jago Douma
c007ca624f
Make phpunit8 compatible
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2019-11-27 13:34:41 +01:00
Joas Schilling
092d34d9df
Add a unit test for guests as well
Signed-off-by: Joas Schilling <coding@schilljs.com>
2019-07-11 10:24:27 +02:00
Joas Schilling
10ba0bed8a
Match mentions when the username is wrapped in quotes
Signed-off-by: Joas Schilling <coding@schilljs.com>
2018-11-07 12:33:44 +01:00
Joas Schilling
66945f9574
Allow to filter the unread count by verb
Signed-off-by: Joas Schilling <coding@schilljs.com>
2018-07-30 09:41:51 +02:00
Joas Schilling
ac2314e3d0 Add pagination support
Signed-off-by: Joas Schilling <coding@schilljs.com>
2018-07-25 18:53:45 +02:00
Joas Schilling
8c7969e730 Allow to search by comments
Signed-off-by: Joas Schilling <coding@schilljs.com>
2018-07-25 18:53:44 +02:00
Mario Danic
d959ca8eb0 Add another test
Signed-off-by: Mario Danic <mario@lovelyhq.com>
2018-06-08 17:21:46 +02:00
Mario Danic
5acdd45b77 Add a new regex test
Signed-off-by: Mario Danic <mario@lovelyhq.com>
2018-06-08 17:15:41 +02:00
Joas Schilling
cccdfaa6e9
Fix FakeManager
Signed-off-by: Joas Schilling <coding@schilljs.com>
2018-04-19 17:12:07 +02:00
Joas Schilling
f50abde7ac
Add proper comment offset support
The offset is based on the last known comment instead of limit-offset,
so new comments don't mess up requests which get the history of an object-

Signed-off-by: Joas Schilling <coding@schilljs.com>
2018-04-18 14:23:15 +02:00
Arthur Schiwon
3784fa2074
comments should compile mentions also if done by author
it is used by clients for formatting reasons, there is no reason not format
the author if her handle is included in the comment body.
It is unrelated to sending out notifications.

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2018-01-17 13:48:43 +01:00
Arthur Schiwon
d5f1cef642
fix comment sorter
background: we have a flat hierarchy of comments, not a tree. therefore we
can also remove again the unnecessary additions.

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2017-10-30 15:59:43 +01:00
Arthur Schiwon
fd6daf8d19
AutoCompletion backend
* introduce a Controller for requests
* introduce result sorting mechanism
* extend Comments to retrieve commentors (actors) in a tree
* add commenters sorter
* add share recipients sorter

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2017-10-22 14:13:32 +02:00
Joas Schilling
20f8d1094a
Can not insert auto increment on oracle
Signed-off-by: Joas Schilling <coding@schilljs.com>
2017-08-02 09:48:16 +02:00
Robin Appelman
2a4d9f71af
update FakeManager
Signed-off-by: Robin Appelman <robin@icewind.nl>
2017-03-30 12:48:34 +02:00
Robin Appelman
212d9fd277
Add test for getting unread comment count by folder
Signed-off-by: Robin Appelman <robin@icewind.nl>
2017-03-30 12:48:27 +02:00
Morris Jobke
cde7f535bd Merge pull request #1738 from nextcloud/comments-provide-displaynames-with-mentions
comment mentions: show displayname not uid
2016-10-26 14:02:49 +02:00
Roeland Jago Douma
eaf152efeb
Fix DateTime comparisson
Datetime now returns microseconds. But if the database doesn't store
those comparing them for equality most likely fails.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2016-10-21 13:43:39 +02:00
Arthur Schiwon
e5ce61b174
add missing methods to test fake manager
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2016-10-20 14:32:32 +02:00
Arthur Schiwon
5d98ab83e9
resolve displayname via manager and registerable resolvers
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2016-10-19 00:34:00 +02:00
Arthur Schiwon
fea3e20a80
move mention extraction to (I)Comment and report mentions via DAV
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2016-10-19 00:33:55 +02:00
Arthur Schiwon
1bcd2ca8e3
emit pre-update event for comments
* notifications can be cleaned up, no polluted DB
* updating comments will re-notify users or remove notifications, depending on the message

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2016-10-12 18:06:22 +02:00
Arthur Schiwon
e1073cf442
Notificacations for simple @-mentioning in comments
(WIP) notify user when mentioned in comments

Fix doc, and create absolute URL for as notification link.

PSR-4 compatibility changes

also move notification creation to comments app

Do not notify yourself

unit test for controller and application

smaller fixes

- translatable app name
- remove doubles in mention array
- micro perf optimization
- display name: special label for deleted users, keep user id for users that could not be fetched from userManager

Comment Notification-Listener Unit Test

fix email adresses

remove notification when triggering comment was deleted

add and adjust tests

add missing @license tags

simplify NotificationsController registration

appinfo simplification, php docs

make string easier to translate

adjust test

replace dispatcher-based listeners with a registration method and interface

safer to not pass optional data parameter to setSubject for marking as processed. ID and mention suffices

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>

update comment

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2016-10-07 17:11:19 +02:00
Lukas Reschke
d5f39164a1
Add test for setTopmostParentId and getTopmostParentId
This wasn't tested before as proven by the coverage data.

Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
2016-09-29 22:43:48 +02:00
Roeland Jago Douma
16e88a7ebf
Fix getMock ManagerTest 2016-09-13 09:09:52 +02:00