aboutsummaryrefslogtreecommitdiffstats
path: root/lib/public/UserStatus
diff options
context:
space:
mode:
authorCarl Schwan <carl@carlschwan.eu>2021-08-11 10:36:24 +0200
committerCarl Schwan <carl@carlschwan.eu>2021-10-18 20:31:37 +0200
commit2cb48f484bd134dd4f9af355365ac6a86f0b81d0 (patch)
treee4b664986dbf5c889d15de94327081b8b7c5b566 /lib/public/UserStatus
parent643e85cfe81ac079bd2e5bcf1a344a20319f48db (diff)
downloadnextcloud-server-2cb48f484bd134dd4f9af355365ac6a86f0b81d0.tar.gz
nextcloud-server-2cb48f484bd134dd4f9af355365ac6a86f0b81d0.zip
Add an API to set and rollback the user status
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
Diffstat (limited to 'lib/public/UserStatus')
-rw-r--r--lib/public/UserStatus/IManager.php21
-rw-r--r--lib/public/UserStatus/IProvider.php2
2 files changed, 22 insertions, 1 deletions
diff --git a/lib/public/UserStatus/IManager.php b/lib/public/UserStatus/IManager.php
index 2f56ca17944..24cef821543 100644
--- a/lib/public/UserStatus/IManager.php
+++ b/lib/public/UserStatus/IManager.php
@@ -40,4 +40,25 @@ interface IManager {
* @since 20.0.0
*/
public function getUserStatuses(array $userIds):array;
+
+
+ /**
+ * Set a new status for the selected user.
+ *
+ * @param string $userId The user for which we want to update the status.
+ * @param string $messageId The id of the predefined message.
+ * @param bool $createBackup If true, this will store the old status so that it is possible to revert it later (e.g. after a call).
+ * @since 23.0.0
+ */
+ public function setUserStatus(string $userId, string $messageId, string $status, bool $createBackup = false): void;
+
+ /**
+ * Revert an automatically set user status. For example after leaving a call,
+ * change back to the previously set status.
+ *
+ * @param string $userId The user for which we want to update the status.
+ * @param string $messageId The expected current messageId. If the user has already updated their status, this method does nothing.
+ * @since 23.0.0
+ */
+ public function revertUserStatus(string $userId, string $messageId, string $status): void;
}
diff --git a/lib/public/UserStatus/IProvider.php b/lib/public/UserStatus/IProvider.php
index ba463e29f4d..976ebbefeab 100644
--- a/lib/public/UserStatus/IProvider.php
+++ b/lib/public/UserStatus/IProvider.php
@@ -26,7 +26,7 @@ declare(strict_types=1);
namespace OCP\UserStatus;
/**
- * Interface IManager
+ * Interface IProvider
*
* @since 20.0.0
*/