Commit Graph

48 Commits

Author SHA1 Message Date
Joas Schilling c0c5340f4e
Fix populating the array and closing the cursors
Signed-off-by: Joas Schilling <coding@schilljs.com>
2021-06-01 09:15:34 +02:00
Simounet a50eba16ad
Fix Oracle query limit compliance in Comments
Signed-off-by: Simounet <contact@simounet.net>
2021-05-28 08:48:01 +02:00
Christoph Wurst d89a75be0b
Update all license headers for Nextcloud 21
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-12-16 18:48:22 +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 2dd50b4adc
Fix return type
Signed-off-by: Joas Schilling <coding@schilljs.com>
2020-10-21 11:02:05 +02:00
Joas Schilling 6400221fba
Less magic
Signed-off-by: Joas Schilling <coding@schilljs.com>
2020-10-21 09:47:40 +02:00
Joas Schilling d462439a63
Get the last comment date for a list of actors (to allow sorting mention suggestions e.g.)
Signed-off-by: Joas Schilling <coding@schilljs.com>
2020-10-21 09:18:51 +02:00
Joas Schilling 89651c5233
Allow to search on multiple objects with one query
Signed-off-by: Joas Schilling <coding@schilljs.com>
2020-10-21 09:16:42 +02:00
Joas Schilling 326640462b
Add methods to get the number of comments and last comment since a date
Signed-off-by: Joas Schilling <coding@schilljs.com>
2020-10-21 09:15:38 +02:00
Joas Schilling 2cc35cc65d
Include an option to also include the lastKnownCommentId object
Signed-off-by: Joas Schilling <coding@schilljs.com>
2020-10-21 09:08:48 +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
Joas Schilling 17454f6ce9
Use PSR logger interface in comments manager
Signed-off-by: Joas Schilling <coding@schilljs.com>
2020-10-07 08:57:45 +02:00
Morris Jobke 99c9423766
Remove @suppress SqlInjectionChecker
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2020-09-16 15:53:56 +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
Joas Schilling 60d9384e5e
Optionally write the reference id into the database
Signed-off-by: Joas Schilling <coding@schilljs.com>
2020-03-31 10:51:16 +02:00
Joas Schilling a20e81f0f3
Allow to set and get the reference id
Signed-off-by: Joas Schilling <coding@schilljs.com>
2020-03-31 10:51:16 +02:00
Arthur Schiwon 4c7bd11fc8
for the DB ot pick an index specify the object_type
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2020-02-03 16:17:25 +01:00
Christoph Wurst 5bf3d1bb38
Update license headers
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2019-12-05 15:38:45 +01:00
Roeland Jago Douma 68748d4f85
Some php-cs fixes
* Order the imports
* No leading slash on imports
* Empty line before namespace
* One line per import
* Empty after imports
* Emmpty line at bottom of file

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2019-11-22 20:52:10 +01:00
Joas Schilling e4b36f4f47
Fix user with id 0 to be able to comment
Signed-off-by: Joas Schilling <coding@schilljs.com>
2019-09-25 09:07:07 +02:00
Joas Schilling 7d3a349d8f
PHPStorm code cleanup
Signed-off-by: Joas Schilling <coding@schilljs.com>
2019-07-24 10:39:57 +02:00
Joas Schilling 3b334169a8
Get the topmost parent for the parent instead of doing endless recursion
Signed-off-by: Joas Schilling <coding@schilljs.com>
2019-07-24 10:39:22 +02:00
Joas Schilling c15c2e440f
Allow apps to overwrite the maximum length when reading from database
Signed-off-by: Joas Schilling <coding@schilljs.com>
2019-07-01 15:48:26 +02:00
Roeland Jago Douma f394bf356e
Rewrite getNumberOfUnreadCommentsForFolder query
Before the joining and filtering removed unkown files. Resulting in
manual queries for all the files with no (unread) comments (the 99%).

Long story short. This will return a list of all the files in the parent
folder with their unread comment count (can be 0). But this makes sure
that the result is properly cached. In the dav handling.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2018-12-20 20:43:10 +01:00
Joas Schilling bb352fb667
Use the defined func()->count() instead of manual counting
Signed-off-by: Joas Schilling <coding@schilljs.com>
2018-11-08 15:44:45 +01:00
Morris Jobke b458ed9c82
Properly escape column name in "createFunction" call
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2018-10-16 15:24:02 +02: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
Joas Schilling 446efa4625
Only query last comment info, when there is one
Signed-off-by: Joas Schilling <coding@schilljs.com>
2018-04-23 11:50:30 +02:00
Joas Schilling 5157349b69
Fix docs
Signed-off-by: Joas Schilling <coding@schilljs.com>
2018-04-19 17:10:03 +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
Morris Jobke c1e4f9f305
Use type casting instead of *val() method
It should be up to 6x faster

Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2018-01-26 11:35:42 +01:00
Morris Jobke 0eebff152a
Update license headers
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2017-11-06 16:56:19 +01: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
Joas Schilling b29baababd
Oracle does not support PDO::FETCH_KEY_PAIR
Signed-off-by: Joas Schilling <coding@schilljs.com>
2017-08-02 09:48:12 +02:00
Lukas Reschke 3d2600b039
Add Phan plugin to check for SQL injections
This adds a phan plugin which checks for SQL injections on code using our QueryBuilder, while it isn't perfect it should already catch most potential issues.

As always, static analysis will sometimes have false positives and this is also here the case. So in some cases the analyzer just doesn't know if something is potential user input or not, thus I had to add some `@suppress SqlInjectionChecker` in front of those potential injections.

The Phan plugin hasn't the most awesome code but it works and I also added a file with test cases.

Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
2017-07-20 22:48:13 +02:00
Morris Jobke c54a59d51e
Remove unused use statements
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2017-04-22 19:23:31 -05:00
Robin Appelman 40154dd6a3
use castColumn
Signed-off-by: Robin Appelman <robin@icewind.nl>
2017-03-30 12:48:30 +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
Robin Appelman 429f8ae011
Allow getting the unread comment count for an entire folder at once
Signed-off-by: Robin Appelman <robin@icewind.nl>
2017-03-30 12:48:24 +02:00
Roeland Jago Douma f07d75a4dd
@since 9.2.0 to @since 11.0.0
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2016-11-15 18:51:52 +01: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 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
Joas Schilling ba87db3fcc
Fix others 2016-07-21 18:13:57 +02:00
Lukas Reschke aba539703c
Update license headers 2016-05-26 19:57:24 +02:00
Roeland Jago Douma 653325f254
Move \OC\Comments to PSR-4 2016-04-15 15:54:20 +02:00