Commit Graph

53 Commits (master)

Author SHA1 Message Date
Ferdinand Thiessen d6d6747a73 refactor: apply rector rules for PHPUnit 10
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
2025-10-27 21:56:04 +07:00
Robin Appelman aa15f9d16d
chore: run rector
Signed-off-by: Robin Appelman <robin@icewind.nl>
2025-07-01 22:45:52 +07:00
Robin Appelman 29e39c0a2e
chore: run rector on tests
Signed-off-by: Robin Appelman <robin@icewind.nl>
2025-06-12 18:31:58 +07:00
Joas Schilling 0d79156bb2
test: Speed up comments test
Signed-off-by: Joas Schilling <coding@schilljs.com>
2025-05-21 07:53:23 +07:00
Joas Schilling 7304756e03
test: Sort the reactions before comparing
Signed-off-by: Joas Schilling <coding@schilljs.com>
2025-05-14 11:42:52 +07:00
Joas Schilling d46d2d1acf
test: Fix coding standards
Signed-off-by: Joas Schilling <coding@schilljs.com>
2025-05-05 10:09:22 +07:00
Joas Schilling 10424f248b
test(comments): Make Comments test result output properly readable
Signed-off-by: Joas Schilling <coding@schilljs.com>
2025-05-05 09:38:02 +07:00
Joas Schilling e2cd436205
test: Improve comments manager test output in case of failure
Signed-off-by: Joas Schilling <coding@schilljs.com>
2025-04-09 13:49:16 +07:00
Ferdinand Thiessen db94e10af0
fix: Prevent breaking change in IQueryBuilder
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
2024-10-17 18:31:44 +07:00
Ferdinand Thiessen ee02e3246d
feat(AppFramework): Add full support for date / time / datetime columns
This adds support for all Doctrine supported types, for the column types only the immutable variants needed to be added.
But especially those types are the important ones, as our **Entity** class works by detecting changes through setters.
Meaning if it is mutable, changes like `$entity->date->modfiy()` can not be detected, so the immutable types make more sense here.

Similar the parameter types needed to be added.

`Enity` and `QBMapper` needed to be adjusted so they support (auto map) those types, required when insert or update an entity.

Also added more tests, especially to make sure the mapper really serializes the values correctly.

Co-authored-by: Ferdinand Thiessen <opensource@fthiessen.de>
Co-authored-by: Côme Chilliet <91878298+come-nc@users.noreply.github.com>
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
2024-10-17 18:31:42 +07:00
Christoph Wurst 49dd79eabb
refactor: Add void return type to PHPUnit test methods
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2024-09-15 22:32:31 +07:00
Anna Larch 6c36c54dc6 feat(db): switch from settype to casts
Signed-off-by: Anna Larch <anna@nextcloud.com>
2024-09-15 19:26:58 +07:00
Daniel Kesselberg af6de04e9e
style: update codestyle for coding-standard 1.2.3
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
2024-08-25 19:34:58 +07:00
Julius Härtl 9713dd3fa9
chore: Move comments event handler to use proper event dispatcher
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2024-06-26 18:13:07 +07:00
Andy Scherzinger 1f7e2ba599
chore: Add SPDX header
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
2024-05-13 17:41:36 +07:00
Andrew Summers 6910832170 Refactor `OC\Server::getCommentsManager`
Signed-off-by: Andrew Summers <18727110+summersab@users.noreply.github.com>
2024-03-15 13:14:06 +07:00
Robin Appelman eb5832b8fa refactor: depricate getNumberOfUnreadCommentsForFolder and redo it's implementation based on getNumberOfUnreadCommentsForObjects
Signed-off-by: Robin Appelman <robin@icewind.nl>
2024-03-07 19:19:07 +07:00
Joas Schilling 6056928dc6
feat(comments): Add a meta data column for comments
Signed-off-by: Joas Schilling <coding@schilljs.com>
2023-12-14 14:32:00 +07:00
Vitor Mattos 5ed6722dd2 Cover expire_date with unit tests
Signed-off-by: Vitor Mattos <vitor@php.rio>
2023-04-26 13:21:08 +07:00
Vitor Mattos e9295f739e Split the comments ids by chunks
Split the comments ids by chunks to prevent error with Oracle database
that can't do a query with more than 1000 parameters.

https://github.com/nextcloud/spreed/issues/8287

Signed-off-by: Vitor Mattos <vitor@php.rio>
2023-03-01 13:08:17 +07:00
Vitor Mattos 7a0648757a
Delete comments that expired now
Signed-off-by: Vitor Mattos <vitor@php.rio>
2022-07-25 11:30:20 +07:00
Joas Schilling 198224bf7a
Allow to expire comments of multiple objects with one call
Signed-off-by: Joas Schilling <coding@schilljs.com>
2022-07-01 15:59:29 +07:00
Vitor Mattos 3be1217c04
Follow the most common pattern used in project
```
git grep strval|wc -l
32
git grep "(string)"|wc -l
481
```

Signed-off-by: Vitor Mattos <vitor@php.rio>
2022-06-20 11:46:13 +07:00
Vitor Mattos c59b0c2ff7
Add comments expire date
https://github.com/nextcloud/spreed/pull/7327

Signed-off-by: Vitor Mattos <vitor@php.rio>
2022-06-15 11:58:29 +07:00
Joas Schilling 902476fa20
Extract the EmojiService from user status and add an OCP interface
Signed-off-by: Joas Schilling <coding@schilljs.com>
2022-04-28 07:09:44 +07:00
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 +07:00
Vitor Mattos 7bb01b6ccc
Refactor and fixes on tests
Signed-off-by: Vitor Mattos <vitor@php.rio>
2022-01-21 08:40:29 +07: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 +07: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 +07: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 +07: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 +07: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 +07:00
Vitor Mattos 425b5cf081
Add unit tests
Signed-off-by: Vitor Mattos <vitor@php.rio>
2022-01-21 08:37:06 +07:00
Joas Schilling 1f1244fdcc
Fix PHP CS
Signed-off-by: Joas Schilling <coding@schilljs.com>
2020-10-22 11:00:54 +07:00
Joas Schilling 8600e51df5
Fix manager creation and testing
Signed-off-by: Joas Schilling <coding@schilljs.com>
2020-10-22 10:54:03 +07: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 +07: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 +07: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 +07: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 +07:00
Roeland Jago Douma 3a7cf40aaa
Mode to modern phpunit
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2019-11-27 15:27:18 +07:00
Roeland Jago Douma c007ca624f
Make phpunit8 compatible
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2019-11-27 13:34:41 +07: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 +07: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 +07: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 +07: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 +07: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 +07: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 +07: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 +07: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 +07: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 +07:00