diff options
author | Anna Larch <anna@nextcloud.com> | 2024-02-08 18:10:59 +0100 |
---|---|---|
committer | Anna <anna@nextcloud.com> | 2024-02-12 13:24:08 +0100 |
commit | c071fbf3ac9b0f2c7e02db58219fc1edd898001b (patch) | |
tree | 7b1fbb6c4ae9ddf8c90e23c85890655ca0ddd9c0 /apps/user_status/lib | |
parent | 35d0c63abc091e06e0d77e3701b14fdf48539d6d (diff) | |
download | nextcloud-server-c071fbf3ac9b0f2c7e02db58219fc1edd898001b.tar.gz nextcloud-server-c071fbf3ac9b0f2c7e02db58219fc1edd898001b.zip |
fix(userstatus): add back 0 timestamp for status without message
Signed-off-by: Anna Larch <anna@nextcloud.com>
Diffstat (limited to 'apps/user_status/lib')
-rw-r--r-- | apps/user_status/lib/Service/StatusService.php | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/apps/user_status/lib/Service/StatusService.php b/apps/user_status/lib/Service/StatusService.php index 813f6b9d4e1..be3a12ef44d 100644 --- a/apps/user_status/lib/Service/StatusService.php +++ b/apps/user_status/lib/Service/StatusService.php @@ -297,7 +297,13 @@ class StatusService { $userStatus->setCustomIcon(null); $userStatus->setCustomMessage($customMessage); $userStatus->setClearAt(null); - $userStatus->setStatusMessageTimestamp($this->timeFactory->now()->getTimestamp()); + if ($this->predefinedStatusService->getTranslatedStatusForId($messageId) !== null + || ($customMessage !== null && $customMessage !== '')) { + // Only track status message ID if there is one + $userStatus->setStatusMessageTimestamp($this->timeFactory->now()->getTimestamp()); + } else { + $userStatus->setStatusMessageTimestamp(0); + } if ($userStatus->getId() !== null) { return $this->mapper->update($userStatus); |