aboutsummaryrefslogtreecommitdiffstats
path: root/lib/public/Comments
diff options
context:
space:
mode:
authorVitor Mattos <vitor@php.rio>2022-01-27 13:07:48 -0300
committerVitor Mattos <vitor@php.rio>2022-02-03 12:52:18 -0300
commit8ec7c5c8ae5432c2ca2e738032d7d1118840c840 (patch)
tree6a2f15d4a77fe1ff09d6f42f3bbb1f38055f055f /lib/public/Comments
parentd635d58d19d5ab65c0be754fc32fce99672c249f (diff)
downloadnextcloud-server-8ec7c5c8ae5432c2ca2e738032d7d1118840c840.tar.gz
nextcloud-server-8ec7c5c8ae5432c2ca2e738032d7d1118840c840.zip
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>
Diffstat (limited to 'lib/public/Comments')
-rw-r--r--lib/public/Comments/ICommentsManager.php53
1 files changed, 53 insertions, 0 deletions
diff --git a/lib/public/Comments/ICommentsManager.php b/lib/public/Comments/ICommentsManager.php
index 178401056c7..c34bd4718cc 100644
--- a/lib/public/Comments/ICommentsManager.php
+++ b/lib/public/Comments/ICommentsManager.php
@@ -29,6 +29,7 @@
namespace OCP\Comments;
use OCP\IUser;
+use OCP\PreConditionNotMetException;
/**
* Interface ICommentsManager
@@ -301,6 +302,58 @@ interface ICommentsManager {
public function delete($id);
/**
+ * Get comment related with user reaction
+ *
+ * Throws PreConditionNotMetException when the system haven't the minimum requirements to
+ * use reactions
+ *
+ * @param int $parentId
+ * @param string $actorType
+ * @param string $actorId
+ * @param string $reaction
+ * @return IComment
+ * @throws NotFoundException
+ * @throws PreConditionNotMetException
+ * @since 24.0.0
+ */
+ public function getReactionComment(int $parentId, string $actorType, string $actorId, string $reaction): IComment;
+
+ /**
+ * Retrieve all reactions of a message
+ *
+ * Throws PreConditionNotMetException when the system haven't the minimum requirements to
+ * use reactions
+ *
+ * @param int $parentId
+ * @return IComment[]
+ * @throws PreConditionNotMetException
+ * @since 24.0.0
+ */
+ public function retrieveAllReactions(int $parentId): array;
+
+ /**
+ * Retrieve all reactions with specific reaction of a message
+ *
+ * Throws PreConditionNotMetException when the system haven't the minimum requirements to
+ * use reactions
+ *
+ * @param int $parentId
+ * @param string $reaction
+ * @return IComment[]
+ * @throws PreConditionNotMetException
+ * @since 24.0.0
+ */
+ public function retrieveAllReactionsWithSpecificReaction(int $parentId, string $reaction): array;
+
+ /**
+ * Support reactions
+ *
+ * @return bool
+ * @since 24.0.0
+ */
+ public function supportReactions(): bool;
+
+ /**
* saves the comment permanently
*
* if the supplied comment has an empty ID, a new entry comment will be