aboutsummaryrefslogtreecommitdiffstats
path: root/lib/public
diff options
context:
space:
mode:
authorRoeland Jago Douma <rullzer@users.noreply.github.com>2020-10-27 19:57:55 +0100
committerGitHub <noreply@github.com>2020-10-27 19:57:55 +0100
commiteadce7fadd652978a0f64c39f983e28b2a657a94 (patch)
treee62095f7cdbc1d3433818febd7ba4764305b2126 /lib/public
parent49854f58d31a8e2d2f9dd24e17a14357dc8f4da9 (diff)
parentda3d384426d0e00561a23ded4f3dafe56b5f761f (diff)
downloadnextcloud-server-eadce7fadd652978a0f64c39f983e28b2a657a94.tar.gz
nextcloud-server-eadce7fadd652978a0f64c39f983e28b2a657a94.zip
Merge pull request #23601 from nextcloud/techdebt/noid/comments-manager-improvements
Comments manager improvements/extensions needed by Talk
Diffstat (limited to 'lib/public')
-rw-r--r--lib/public/Comments/ICommentsManager.php56
1 files changed, 55 insertions, 1 deletions
diff --git a/lib/public/Comments/ICommentsManager.php b/lib/public/Comments/ICommentsManager.php
index 95f0d2ce300..b179b8a7464 100644
--- a/lib/public/Comments/ICommentsManager.php
+++ b/lib/public/Comments/ICommentsManager.php
@@ -128,6 +128,7 @@ interface ICommentsManager {
* @param string $sortDirection direction of the comments (`asc` or `desc`)
* @param int $limit optional, number of maximum comments to be returned. if
* set to 0, all comments are returned.
+ * @param bool $includeLastKnown
* @return IComment[]
* @since 14.0.0
*/
@@ -136,7 +137,8 @@ interface ICommentsManager {
string $objectId,
int $lastKnownCommentId,
string $sortDirection = 'asc',
- int $limit = 30
+ int $limit = 30,
+ bool $includeLastKnown = false
): array;
/**
@@ -154,6 +156,20 @@ interface ICommentsManager {
public function search(string $search, string $objectType, string $objectId, string $verb, int $offset, int $limit = 50): array;
/**
+ * Search for comments on one or more objects with a given content
+ *
+ * @param string $search content to search for
+ * @param string $objectType Limit the search by object type
+ * @param array $objectIds Limit the search by object ids
+ * @param string $verb Limit the verb of the comment
+ * @param int $offset
+ * @param int $limit
+ * @return IComment[]
+ * @since 21.0.0
+ */
+ public function searchForObjects(string $search, string $objectType, array $objectIds, string $verb, int $offset, int $limit = 50): array;
+
+ /**
* @param $objectType string the object type, e.g. 'files'
* @param $objectId string the id of the object
* @param \DateTime|null $notOlderThan optional, timestamp of the oldest comments
@@ -165,6 +181,44 @@ interface ICommentsManager {
public function getNumberOfCommentsForObject($objectType, $objectId, \DateTime $notOlderThan = null, $verb = '');
/**
+ * @param string $objectType
+ * @param string $objectId
+ * @param int $lastRead
+ * @param string $verb
+ * @return int
+ * @since 21.0.0
+ */
+ public function getNumberOfCommentsForObjectSinceComment(string $objectType, string $objectId, int $lastRead, string $verb = ''): int;
+
+ /**
+ * @param string $objectType
+ * @param string $objectId
+ * @param \DateTime $beforeDate
+ * @param string $verb
+ * @return int
+ * @since 21.0.0
+ */
+ public function getLastCommentBeforeDate(string $objectType, string $objectId, \DateTime $beforeDate, string $verb = ''): int;
+
+ /**
+ * @param string $objectType
+ * @param string $objectId
+ * @param string $verb
+ * @param string $actorType
+ * @param string[] $actors
+ * @return \DateTime[] Map of "string actor" => "\DateTime most recent comment date"
+ * @psalm-return array<string, \DateTime>
+ * @since 21.0.0
+ */
+ public function getLastCommentDateByActor(
+ string $objectType,
+ string $objectId,
+ string $verb,
+ string $actorType,
+ array $actors
+ ): array;
+
+ /**
* Get the number of unread comments for all files in a folder
*
* @param int $folderId