aboutsummaryrefslogtreecommitdiffstats
path: root/lib/public/Talk
diff options
context:
space:
mode:
Diffstat (limited to 'lib/public/Talk')
-rw-r--r--lib/public/Talk/Exceptions/NoBackendException.php22
-rw-r--r--lib/public/Talk/IBroker.php38
-rw-r--r--lib/public/Talk/IConversation.php29
-rw-r--r--lib/public/Talk/IConversationOptions.php23
-rw-r--r--lib/public/Talk/ITalkBackend.php37
5 files changed, 47 insertions, 102 deletions
diff --git a/lib/public/Talk/Exceptions/NoBackendException.php b/lib/public/Talk/Exceptions/NoBackendException.php
index 9e3187a27ca..4e7a8d50769 100644
--- a/lib/public/Talk/Exceptions/NoBackendException.php
+++ b/lib/public/Talk/Exceptions/NoBackendException.php
@@ -2,25 +2,9 @@
declare(strict_types=1);
-/*
- * @copyright 2021 Christoph Wurst <christoph@winzerhof-wurst.at>
- *
- * @author 2021 Christoph Wurst <christoph@winzerhof-wurst.at>
- *
- * @license GNU AGPL version 3 or any later version
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
+/**
+ * SPDX-FileCopyrightText: 2021 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace OCP\Talk\Exceptions;
diff --git a/lib/public/Talk/IBroker.php b/lib/public/Talk/IBroker.php
index d28771544c8..cfea4af6873 100644
--- a/lib/public/Talk/IBroker.php
+++ b/lib/public/Talk/IBroker.php
@@ -2,25 +2,9 @@
declare(strict_types=1);
-/*
- * @copyright 2021 Christoph Wurst <christoph@winzerhof-wurst.at>
- *
- * @author 2021 Christoph Wurst <christoph@winzerhof-wurst.at>
- *
- * @license GNU AGPL version 3 or any later version
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
+/**
+ * SPDX-FileCopyrightText: 2021 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace OCP\Talk;
@@ -36,7 +20,6 @@ use OCP\Talk\Exceptions\NoBackendException;
* @since 24.0.0
*/
interface IBroker {
-
/**
* Check if the Talk backend is available
*
@@ -69,6 +52,17 @@ interface IBroker {
* @since 24.0.0
*/
public function createConversation(string $name,
- array $moderators,
- IConversationOptions $options = null): IConversation;
+ 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..377f76d8809 100644
--- a/lib/public/Talk/IConversation.php
+++ b/lib/public/Talk/IConversation.php
@@ -2,25 +2,9 @@
declare(strict_types=1);
-/*
- * @copyright 2021 Christoph Wurst <christoph@winzerhof-wurst.at>
- *
- * @author 2021 Christoph Wurst <christoph@winzerhof-wurst.at>
- *
- * @license GNU AGPL version 3 or any later version
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
+/**
+ * SPDX-FileCopyrightText: 2021 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace OCP\Talk;
@@ -29,6 +13,13 @@ namespace OCP\Talk;
* @since 24.0.0
*/
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
diff --git a/lib/public/Talk/IConversationOptions.php b/lib/public/Talk/IConversationOptions.php
index 020a98cc405..9433bad9893 100644
--- a/lib/public/Talk/IConversationOptions.php
+++ b/lib/public/Talk/IConversationOptions.php
@@ -2,25 +2,9 @@
declare(strict_types=1);
-/*
- * @copyright 2021 Christoph Wurst <christoph@winzerhof-wurst.at>
- *
- * @author 2021 Christoph Wurst <christoph@winzerhof-wurst.at>
- *
- * @license GNU AGPL version 3 or any later version
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
+/**
+ * SPDX-FileCopyrightText: 2021 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace OCP\Talk;
@@ -29,7 +13,6 @@ namespace OCP\Talk;
* @since 24.0.0
*/
interface IConversationOptions {
-
/**
* Will the conversation be public?
*
diff --git a/lib/public/Talk/ITalkBackend.php b/lib/public/Talk/ITalkBackend.php
index 700d5d8c4d3..66dbd3c485d 100644
--- a/lib/public/Talk/ITalkBackend.php
+++ b/lib/public/Talk/ITalkBackend.php
@@ -2,25 +2,9 @@
declare(strict_types=1);
-/*
- * @copyright 2021 Christoph Wurst <christoph@winzerhof-wurst.at>
- *
- * @author 2021 Christoph Wurst <christoph@winzerhof-wurst.at>
- *
- * @license GNU AGPL version 3 or any later version
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
+/**
+ * SPDX-FileCopyrightText: 2021 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace OCP\Talk;
@@ -37,7 +21,6 @@ use OCP\IUser;
* @since 24.0.0
*/
interface ITalkBackend {
-
/**
* @param string $name
* @param IUser[] $moderators
@@ -47,6 +30,16 @@ interface ITalkBackend {
* @since 24.0.0
*/
public function createConversation(string $name,
- array $moderators,
- IConversationOptions $options): IConversation;
+ 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;
}