aboutsummaryrefslogtreecommitdiffstats
path: root/apps/user_status/lib/Controller
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2020-09-30 14:12:02 +0200
committerJoas Schilling <coding@schilljs.com>2020-09-30 14:12:02 +0200
commit32b577a5df926b7de030e6d7abb5c7fe2f1c171a (patch)
treeb56426504fcd989d55420ed734e9ab33d966b3b0 /apps/user_status/lib/Controller
parentaeb7329b3db0b1cbfa41bdedf9bccb230a3910d8 (diff)
downloadnextcloud-server-32b577a5df926b7de030e6d7abb5c7fe2f1c171a.tar.gz
nextcloud-server-32b577a5df926b7de030e6d7abb5c7fe2f1c171a.zip
Reset the user status when clearing the custom message
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'apps/user_status/lib/Controller')
-rw-r--r--apps/user_status/lib/Controller/UserStatusController.php7
1 files changed, 6 insertions, 1 deletions
diff --git a/apps/user_status/lib/Controller/UserStatusController.php b/apps/user_status/lib/Controller/UserStatusController.php
index ffbe1e753ef..950cafb104d 100644
--- a/apps/user_status/lib/Controller/UserStatusController.php
+++ b/apps/user_status/lib/Controller/UserStatusController.php
@@ -138,7 +138,12 @@ class UserStatusController extends OCSController {
string $message,
?int $clearAt): DataResponse {
try {
- $status = $this->service->setCustomMessage($this->userId, $statusIcon, $message, $clearAt);
+ if ($message !== '') {
+ $status = $this->service->setCustomMessage($this->userId, $statusIcon, $message, $clearAt);
+ } else {
+ $this->service->clearMessage($this->userId);
+ $status = $this->service->findByUserId($this->userId);
+ }
return new DataResponse($this->formatStatus($status));
} catch (InvalidClearAtException $ex) {
$this->logger->debug('New user-status for "' . $this->userId . '" was rejected due to an invalid clearAt value "' . $clearAt . '"');