aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorChristoph Wurst <christoph@winzerhof-wurst.at>2022-10-31 11:44:39 +0100
committerChristoph Wurst <christoph@winzerhof-wurst.at>2022-10-31 11:44:39 +0100
commit06627c800c45672d57a255f494c5d47efd160aff (patch)
treeb9e77b3d66f34626f73126a38f6a83e397f69549 /lib
parent7c39e3e6bdae6dd70c804d1d4c5084ecc0b2ce54 (diff)
downloadnextcloud-server-06627c800c45672d57a255f494c5d47efd160aff.tar.gz
nextcloud-server-06627c800c45672d57a255f494c5d47efd160aff.zip
Add Talk converstation delete API
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'lib')
-rw-r--r--lib/private/Talk/Broker.php8
-rw-r--r--lib/public/Talk/IBroker.php11
-rw-r--r--lib/public/Talk/IConversation.php8
-rw-r--r--lib/public/Talk/ITalkBackend.php10
4 files changed, 37 insertions, 0 deletions
diff --git a/lib/private/Talk/Broker.php b/lib/private/Talk/Broker.php
index a686adeed04..12e6c5fb34b 100644
--- a/lib/private/Talk/Broker.php
+++ b/lib/private/Talk/Broker.php
@@ -106,4 +106,12 @@ class Broker implements IBroker {
$options ?? ConversationOptions::default()
);
}
+
+ public function deleteConversation(string $id): void {
+ if (!$this->hasBackend()) {
+ throw new NoBackendException("The Talk broker has no registered backend");
+ }
+
+ $this->backend->deleteConversation($id);
+ }
}
diff --git a/lib/public/Talk/IBroker.php b/lib/public/Talk/IBroker.php
index d28771544c8..705c39d2c01 100644
--- a/lib/public/Talk/IBroker.php
+++ b/lib/public/Talk/IBroker.php
@@ -71,4 +71,15 @@ interface IBroker {
public function createConversation(string $name,
array $moderators,
IConversationOptions $options = null): IConversation;
+
+ /**
+ * Delete a conversation by id
+ *
+ * @param string $id conversation id
+ *
+ * @return void
+ * @throws NoBackendException when Talk is not available
+ * @since 26.0.0
+ */
+ public function deleteConversation(string $id): void;
}
diff --git a/lib/public/Talk/IConversation.php b/lib/public/Talk/IConversation.php
index 43698b9069f..efa33c0b357 100644
--- a/lib/public/Talk/IConversation.php
+++ b/lib/public/Talk/IConversation.php
@@ -31,6 +31,14 @@ namespace OCP\Talk;
interface IConversation {
/**
+ * Get the unique token that identifies this conversation
+ *
+ * @return string
+ * @since 26.0.0
+ */
+ public function getId(): string;
+
+ /**
* Get the absolute URL to this conversation
*
* @return string
diff --git a/lib/public/Talk/ITalkBackend.php b/lib/public/Talk/ITalkBackend.php
index 700d5d8c4d3..605a15680d0 100644
--- a/lib/public/Talk/ITalkBackend.php
+++ b/lib/public/Talk/ITalkBackend.php
@@ -49,4 +49,14 @@ interface ITalkBackend {
public function createConversation(string $name,
array $moderators,
IConversationOptions $options): IConversation;
+
+ /**
+ * Delete a conversation by id
+ *
+ * @param string $id conversation id
+ *
+ * @return void
+ * @since 26.0.0
+ */
+ public function deleteConversation(string $id): void;
}