diff options
author | Carl Schwan <carl@carlschwan.eu> | 2021-08-11 10:36:24 +0200 |
---|---|---|
committer | Carl Schwan <carl@carlschwan.eu> | 2021-10-18 20:31:37 +0200 |
commit | 2cb48f484bd134dd4f9af355365ac6a86f0b81d0 (patch) | |
tree | e4b664986dbf5c889d15de94327081b8b7c5b566 /apps/user_status/lib/Controller | |
parent | 643e85cfe81ac079bd2e5bcf1a344a20319f48db (diff) | |
download | nextcloud-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 'apps/user_status/lib/Controller')
-rw-r--r-- | apps/user_status/lib/Controller/PredefinedStatusController.php | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/apps/user_status/lib/Controller/PredefinedStatusController.php b/apps/user_status/lib/Controller/PredefinedStatusController.php index 50148650ad8..ea1ff5209b8 100644 --- a/apps/user_status/lib/Controller/PredefinedStatusController.php +++ b/apps/user_status/lib/Controller/PredefinedStatusController.php @@ -60,6 +60,9 @@ class PredefinedStatusController extends OCSController { * @return DataResponse */ public function findAll():DataResponse { - return new DataResponse($this->predefinedStatusService->getDefaultStatuses()); + // Filtering out the invisible one, that should only be set by API + return new DataResponse(array_filter($this->predefinedStatusService->getDefaultStatuses(), function (array $status) { + return !array_key_exists('visible', $status) || $status['visible'] === true; + })); } } |