fix(userstatus): add back 0 timestamp for status without message

Signed-off-by: Anna Larch <anna@nextcloud.com>
pull/43464/head
Anna Larch 10 months ago committed by Anna
parent 35d0c63abc
commit c071fbf3ac
  1. 8
      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);

Loading…
Cancel
Save