Skip to content

Commit

Permalink
Merge pull request #9990 from nextcloud/fix/autoresponder/enable-on-o…
Browse files Browse the repository at this point in the history
…oo-started

fix(autoresponder): enable immediately on an OutOfOfficeStartedEvent
  • Loading branch information
st3iny authored Aug 14, 2024
2 parents 4c7f3f1 + 783263d commit a828f74
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/Listener/OutOfOfficeListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@ public function handle(Event $event): void {
// check inside the sieve script acts as a redundancy.
$now = $this->timeFactory->getTime();
$enabled = $now >= $eventData->getStartDate() && $now < $eventData->getEndDate();
if (($event instanceof OutOfOfficeClearedEvent) || ($event instanceof OutOfOfficeEndedEvent)) {
if ($event instanceof OutOfOfficeStartedEvent) {
$enabled = true;
} elseif (($event instanceof OutOfOfficeClearedEvent) || ($event instanceof OutOfOfficeEndedEvent)) {
$enabled = false;
}

Expand Down

0 comments on commit a828f74

Please sign in to comment.