aboutsummaryrefslogtreecommitdiffstats
path: root/apps/user_status/lib/Controller/UserStatusController.php
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2023-02-24 16:38:32 +0100
committerMaksim Sukharev <antreesy.web@gmail.com>2023-04-18 14:57:44 +0200
commit64776ff042d880eac5d702d3cbc7af4fb0834be2 (patch)
tree5872ca565b5365a8c006169ffb8f621ddfdf723f /apps/user_status/lib/Controller/UserStatusController.php
parent1a255379e85f02f3fb301f709720f3210f56b011 (diff)
downloadnextcloud-server-64776ff042d880eac5d702d3cbc7af4fb0834be2.tar.gz
nextcloud-server-64776ff042d880eac5d702d3cbc7af4fb0834be2.zip
feat(user_status): Allow to manually revert an automated status
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'apps/user_status/lib/Controller/UserStatusController.php')
-rw-r--r--apps/user_status/lib/Controller/UserStatusController.php13
1 files changed, 13 insertions, 0 deletions
diff --git a/apps/user_status/lib/Controller/UserStatusController.php b/apps/user_status/lib/Controller/UserStatusController.php
index 214dc21f453..aded923d07f 100644
--- a/apps/user_status/lib/Controller/UserStatusController.php
+++ b/apps/user_status/lib/Controller/UserStatusController.php
@@ -185,6 +185,19 @@ class UserStatusController extends OCSController {
}
/**
+ * @NoAdminRequired
+ *
+ * @return DataResponse
+ */
+ public function revertStatus(string $messageId): DataResponse {
+ $backupStatus = $this->service->revertUserStatus($this->userId, $messageId, true);
+ if ($backupStatus) {
+ return new DataResponse($this->formatStatus($backupStatus));
+ }
+ return new DataResponse([]);
+ }
+
+ /**
* @param UserStatus $status
* @return array
*/