Skip to content

Commit

Permalink
Merge pull request #43464 from nextcloud/fix/43089/empty-dashboard-us…
Browse files Browse the repository at this point in the history
…erstatus

fix(userstatus): add back 0 timestamp for status without message
  • Loading branch information
ChristophWurst authored Feb 12, 2024
2 parents 35d0c63 + c071fbf commit 9192886
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 9192886

Please sign in to comment.