From: provokateurin Date: Sat, 30 Dec 2023 13:38:58 +0000 (+0100) Subject: fix(user_status): Allow setting custom message with icon only X-Git-Tag: v29.0.0beta1~534^2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=refs%2Fpull%2F42532%2Fhead;p=nextcloud-server.git fix(user_status): Allow setting custom message with icon only Signed-off-by: provokateurin --- diff --git a/apps/user_status/lib/Controller/UserStatusController.php b/apps/user_status/lib/Controller/UserStatusController.php index 3beb8abc3ab..a85f4f1353a 100644 --- a/apps/user_status/lib/Controller/UserStatusController.php +++ b/apps/user_status/lib/Controller/UserStatusController.php @@ -149,7 +149,7 @@ class UserStatusController extends OCSController { ?string $message, ?int $clearAt): DataResponse { try { - if (($message !== null && $message !== '') || ($clearAt !== null && $clearAt !== 0)) { + if (($statusIcon !== null && $statusIcon !== '') || ($message !== null && $message !== '') || ($clearAt !== null && $clearAt !== 0)) { $status = $this->service->setCustomMessage($this->userId, $statusIcon, $message, $clearAt); } else { $this->service->clearMessage($this->userId); diff --git a/apps/user_status/tests/Unit/Controller/UserStatusControllerTest.php b/apps/user_status/tests/Unit/Controller/UserStatusControllerTest.php index 6161eb100ec..d3b6d2002e0 100644 --- a/apps/user_status/tests/Unit/Controller/UserStatusControllerTest.php +++ b/apps/user_status/tests/Unit/Controller/UserStatusControllerTest.php @@ -330,7 +330,7 @@ class UserStatusControllerTest extends TestCase { return [ ['👨🏽‍💻', 'Busy developing the status feature', 500, true, false, null, false, null], ['👨🏽‍💻', '', 500, true, false, null, false, null, false], - ['👨🏽‍💻', '', 0, true, false, null, false, null, true], + ['👨🏽‍💻', '', 0, true, false, null, false, null, false], ['👨🏽‍💻', 'Busy developing the status feature', 500, false, true, new InvalidClearAtException('Original exception message'), true, 'New user-status for "john.doe" was rejected due to an invalid clearAt value "500"'], ['👨🏽‍💻', 'Busy developing the status feature', 500, false, true, new InvalidStatusIconException('Original exception message'), true,