Skip to content

Commit

Permalink
fix(userstatus): add back 0 timestamp for status without message
Browse files Browse the repository at this point in the history
Signed-off-by: Anna Larch <anna@nextcloud.com>
  • Loading branch information
miaulalala authored and backportbot[bot] committed Feb 12, 2024
1 parent 243d31c commit ca179b7
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion apps/user_status/lib/Service/StatusService.php
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,13 @@ public function setUserStatus(string $userId,
$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);
Expand Down

0 comments on commit ca179b7

Please sign in to comment.