Skip to content

Commit

Permalink
fix(autoresponder): enable immediately on an OutOfOfficeStartedEvent
Browse files Browse the repository at this point in the history
Signed-off-by: Richard Steinmetz <[email protected]>
  • Loading branch information
st3iny committed Aug 13, 2024
1 parent 0b15b42 commit 462fa8e
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;
} else if (($event instanceof OutOfOfficeClearedEvent) || ($event instanceof OutOfOfficeEndedEvent)) {
$enabled = false;
}

Expand Down

0 comments on commit 462fa8e

Please sign in to comment.