diff --git a/apps/user_status/lib/Listener/UserLiveStatusListener.php b/apps/user_status/lib/Listener/UserLiveStatusListener.php index 0204d101ec3dd..80bd479b9b1c1 100644 --- a/apps/user_status/lib/Listener/UserLiveStatusListener.php +++ b/apps/user_status/lib/Listener/UserLiveStatusListener.php @@ -76,9 +76,7 @@ public function handle(Event $event): void { $needsUpdate = false; - // If the current status is older than 5 minutes, - // treat it as outdated and update - if ($userStatus->getStatusTimestamp() < ($this->timeFactory->getTime() - StatusService::INVALIDATE_STATUS_THRESHOLD)) { + if ($userStatus->getStatusTimestamp() < ($this->timeFactory->getTime() - StatusService::REFRESH_STATUS_THRESHOLD)) { $needsUpdate = true; } diff --git a/apps/user_status/lib/Service/StatusService.php b/apps/user_status/lib/Service/StatusService.php index 6c1805963c881..471634a266b00 100644 --- a/apps/user_status/lib/Service/StatusService.php +++ b/apps/user_status/lib/Service/StatusService.php @@ -62,6 +62,13 @@ class StatusService { /** @var int */ public const INVALIDATE_STATUS_THRESHOLD = 15 /* minutes */ * 60 /* seconds */; + /** + * Has to stay at least one client heartbeat interval below INVALIDATE_STATUS_THRESHOLD. + * + * @var int + */ + public const REFRESH_STATUS_THRESHOLD = 7 /* minutes */ * 60 /* seconds */; + /** @var int */ public const MAXIMUM_MESSAGE_LENGTH = 80; diff --git a/apps/user_status/src/UserStatus.vue b/apps/user_status/src/UserStatus.vue index 52331c3373b72..789097407288d 100644 --- a/apps/user_status/src/UserStatus.vue +++ b/apps/user_status/src/UserStatus.vue @@ -40,13 +40,13 @@