summaryrefslogtreecommitdiffstats
path: root/apps/dav
diff options
context:
space:
mode:
authorAnna <anna@nextcloud.com>2023-03-13 11:36:38 +0100
committerGitHub <noreply@github.com>2023-03-13 11:36:38 +0100
commit44f452d5cbb48856a1b8eb9c99499a9f19bcf5bf (patch)
tree410ac169db5d2bb64ebeda5b4f63e772513c7c76 /apps/dav
parentade49e0b15e408bf00dd24f5641bd9a29a18f05c (diff)
parent5c5de0bac1bf1bc00c01707f1170446c6d895129 (diff)
downloadnextcloud-server-44f452d5cbb48856a1b8eb9c99499a9f19bcf5bf.tar.gz
nextcloud-server-44f452d5cbb48856a1b8eb9c99499a9f19bcf5bf.zip
Merge pull request #37167 from nextcloud/dav/fix/availability
fix(dav): Handle no next potential toggle in availability detection
Diffstat (limited to 'apps/dav')
-rw-r--r--apps/dav/lib/BackgroundJob/UserStatusAutomation.php7
1 files changed, 7 insertions, 0 deletions
diff --git a/apps/dav/lib/BackgroundJob/UserStatusAutomation.php b/apps/dav/lib/BackgroundJob/UserStatusAutomation.php
index 94feadcae93..8edc28c9a69 100644
--- a/apps/dav/lib/BackgroundJob/UserStatusAutomation.php
+++ b/apps/dav/lib/BackgroundJob/UserStatusAutomation.php
@@ -139,6 +139,13 @@ class UserStatusAutomation extends TimedJob {
}
}
+ if (empty($nextPotentialToggles)) {
+ $this->logger->info('Removing ' . self::class . ' background job for user "' . $userId . '" because the user has no valid availability rules set');
+ $this->jobList->remove(self::class, $argument);
+ $this->manager->revertUserStatus($userId, IUserStatus::MESSAGE_AVAILABILITY, IUserStatus::DND);
+ return;
+ }
+
$nextAutomaticToggle = min($nextPotentialToggles);
$this->setLastRunToNextToggleTime($userId, $nextAutomaticToggle - 1);