aboutsummaryrefslogtreecommitdiffstats
path: root/lib/public/Comments
diff options
context:
space:
mode:
authorVitor Mattos <vitor@php.rio>2022-06-13 12:22:36 -0300
committerVitor Mattos <vitor@php.rio>2022-06-15 11:58:29 -0300
commitc59b0c2ff7701916fbab4c5d544f43a49acabc34 (patch)
tree8d7e2e9bf196d6d39d6e87957791f1e263bab5cd /lib/public/Comments
parent596ead787ba7f7148fceb04de9d7c08cece936bc (diff)
downloadnextcloud-server-c59b0c2ff7701916fbab4c5d544f43a49acabc34.tar.gz
nextcloud-server-c59b0c2ff7701916fbab4c5d544f43a49acabc34.zip
Add comments expire date
https://github.com/nextcloud/spreed/pull/7327 Signed-off-by: Vitor Mattos <vitor@php.rio>
Diffstat (limited to 'lib/public/Comments')
-rw-r--r--lib/public/Comments/IComment.php17
-rw-r--r--lib/public/Comments/ICommentsManager.php11
2 files changed, 28 insertions, 0 deletions
diff --git a/lib/public/Comments/IComment.php b/lib/public/Comments/IComment.php
index 8465eaf49f4..44d294bb07c 100644
--- a/lib/public/Comments/IComment.php
+++ b/lib/public/Comments/IComment.php
@@ -299,4 +299,21 @@ interface IComment {
* @since 24.0.0
*/
public function setReactions(?array $reactions): IComment;
+
+ /**
+ * Set message expire date
+ *
+ * @param \DateTime|null $dateTime
+ * @return IComment
+ * @since 25.0.0
+ */
+ public function setExpireDate(?\DateTime $dateTime): IComment;
+
+ /**
+ * Get message expire date
+ *
+ * @return ?\DateTime
+ * @since 25.0.0
+ */
+ public function getExpireDate(): ?\DateTime;
}
diff --git a/lib/public/Comments/ICommentsManager.php b/lib/public/Comments/ICommentsManager.php
index c34bd4718cc..814ca3e8f9c 100644
--- a/lib/public/Comments/ICommentsManager.php
+++ b/lib/public/Comments/ICommentsManager.php
@@ -482,4 +482,15 @@ interface ICommentsManager {
* @since 21.0.0
*/
public function load(): void;
+
+ /**
+ * Delete comments with field expire_date less than current date
+ * Only will delete the message related with the object.
+ *
+ * @param string $objectType the object type (e.g. 'files')
+ * @param string $objectId e.g. the file id
+ * @return boolean true if at least one row was deleted
+ * @since 25.0.0
+ */
+ public function deleteMessageExpiredAtObject(string $objectType, string $objectId): bool;
}