diff --git a/lib/ITip/Broker.php b/lib/ITip/Broker.php index 76ee0c71..7adc5494 100644 --- a/lib/ITip/Broker.php +++ b/lib/ITip/Broker.php @@ -580,6 +580,9 @@ protected function parseEventForOrganizer(VCalendar $calendar, array $eventInfo, )); } else { $currentEvent->EXDATE = $exceptions; + if ($currentEvent->DTSTART['TZID']) { + $currentEvent->EXDATE['TZID'] = clone $currentEvent->DTSTART['TZID']; + } } } diff --git a/tests/VObject/ITip/BrokerUpdateEventTest.php b/tests/VObject/ITip/BrokerUpdateEventTest.php index 030860bd..64031f6e 100644 --- a/tests/VObject/ITip/BrokerUpdateEventTest.php +++ b/tests/VObject/ITip/BrokerUpdateEventTest.php @@ -876,4 +876,184 @@ public function testInviteStatusCancelled(): void $this->parse($oldMessage, $newMessage, $expected, 'mailto:strunk@example.org'); } + + /* + * When EXDATE is added by Broker, it needs to be in the correct + * timezone + */ + + public function testExdateTimezone(): void + { + $oldMessage = << 'foobar', + 'method' => 'REQUEST', + 'component' => 'VEVENT', + 'sender' => 'mailto:strunk@example.org', + 'senderName' => 'Strunk', + 'recipient' => 'mailto:one@example.org', + 'recipientName' => 'One', + 'significantChange' => true, + 'message' => <<parse($oldMessage, $newMessage, $expected, 'mailto:strunk@example.org'); + } + + /* + * When EXDATE is added by Broker, it needs to be in the correct + * timezone, also in case UTC is used + */ + + public function testExdateTimezoneUTC(): void + { + $oldMessage = << 'foobar', + 'method' => 'REQUEST', + 'component' => 'VEVENT', + 'sender' => 'mailto:strunk@example.org', + 'senderName' => 'Strunk', + 'recipient' => 'mailto:one@example.org', + 'recipientName' => 'One', + 'significantChange' => true, + 'message' => <<parse($oldMessage, $newMessage, $expected, 'mailto:strunk@example.org'); + } }