Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions lib/ITip/Broker.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'];
}
}
}

Expand Down
6 changes: 2 additions & 4 deletions tests/VObject/Component/VAvailabilityTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -435,8 +435,7 @@ protected function template(array $properties)
END:VAVAILABILITY
END:VCALENDAR
VCAL
,
VCAL,
$properties
);
}
Expand All @@ -459,8 +458,7 @@ protected function templateAvailable(array $properties)
END:AVAILABLE
END:VAVAILABILITY
END:VCALENDAR
VCAL
,
VCAL,
$properties
);
}
Expand Down
180 changes: 180 additions & 0 deletions tests/VObject/ITip/BrokerUpdateEventTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -876,4 +876,184 @@ public function testInviteStatusCancelled(): void

$this->parse($oldMessage, $newMessage, $expected, 'mailto:[email protected]');
}

/*
* When EXDATE is added by Broker, it needs to be in the correct
* timezone
*/

public function testExdateTimezone(): void
{
$oldMessage = <<<ICS
BEGIN:VCALENDAR
VERSION:2.0
BEGIN:VEVENT
UID:foobar
SEQUENCE:1
SUMMARY:foo
RRULE:FREQ=WEEKLY
ORGANIZER;CN=Strunk:mailto:[email protected]
ATTENDEE;CN=Strunk;PARTSTAT=ACCEPTED:mailto:[email protected]
ATTENDEE;CN=One:mailto:[email protected]
DTSTART;TZID=Europe/London:20140716T120000
DTEND;TZID=Europe/London:20140716T130000
END:VEVENT
END:VCALENDAR
ICS;

$newMessage = <<<ICS
BEGIN:VCALENDAR
VERSION:2.0
BEGIN:VEVENT
UID:foobar
SEQUENCE:1
SUMMARY:foo
RRULE:FREQ=WEEKLY
ORGANIZER;CN=Strunk:mailto:[email protected]
ATTENDEE;CN=Strunk;PARTSTAT=ACCEPTED:mailto:[email protected]
ATTENDEE;CN=One:mailto:[email protected]
DTSTART;TZID=Europe/London:20140716T120000
DTEND;TZID=Europe/London:20140716T130000
END:VEVENT
BEGIN:VEVENT
UID:foobar
SEQUENCE:1
SUMMARY:foo
RECURRENCE-ID;TZID=Europe/London:20140723T120000
ORGANIZER;CN=Strunk:mailto:[email protected]
ATTENDEE;CN=Strunk;PARTSTAT=ACCEPTED:mailto:[email protected]
DTSTART;TZID=Europe/London:20140723T120000
DTEND;TZID=Europe/London:20140723T130000
END:VEVENT
END:VCALENDAR
ICS;

$version = Version::VERSION;

$expected = [
[
'uid' => 'foobar',
'method' => 'REQUEST',
'component' => 'VEVENT',
'sender' => 'mailto:[email protected]',
'senderName' => 'Strunk',
'recipient' => 'mailto:[email protected]',
'recipientName' => 'One',
'significantChange' => true,
'message' => <<<ICS
BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//Sabre//Sabre VObject 4.5.6//EN
CALSCALE:GREGORIAN
METHOD:REQUEST
BEGIN:VEVENT
UID:foobar
SEQUENCE:1
SUMMARY:foo
RRULE:FREQ=WEEKLY
ORGANIZER;CN=Strunk:mailto:[email protected]
ATTENDEE;CN=Strunk;PARTSTAT=ACCEPTED:mailto:[email protected]
ATTENDEE;CN=One;PARTSTAT=NEEDS-ACTION:mailto:[email protected]
DTSTART;TZID=Europe/London:20140716T120000
DTEND;TZID=Europe/London:20140716T130000
EXDATE;TZID=Europe/London:20140723T120000
DTSTAMP:**ANY**
END:VEVENT
END:VCALENDAR
ICS,
],
];

$this->parse($oldMessage, $newMessage, $expected, 'mailto:[email protected]');
}

/*
* 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 = <<<ICS
BEGIN:VCALENDAR
VERSION:2.0
BEGIN:VEVENT
UID:foobar
SEQUENCE:1
SUMMARY:foo
RRULE:FREQ=WEEKLY
ORGANIZER;CN=Strunk:mailto:[email protected]
ATTENDEE;CN=Strunk;PARTSTAT=ACCEPTED:mailto:[email protected]
ATTENDEE;CN=One:mailto:[email protected]
DTSTART:20140716T120000Z
DTEND:20140716T130000Z
END:VEVENT
END:VCALENDAR
ICS;

$newMessage = <<<ICS
BEGIN:VCALENDAR
VERSION:2.0
BEGIN:VEVENT
UID:foobar
SEQUENCE:1
SUMMARY:foo
RRULE:FREQ=WEEKLY
ORGANIZER;CN=Strunk:mailto:[email protected]
ATTENDEE;CN=Strunk;PARTSTAT=ACCEPTED:mailto:[email protected]
ATTENDEE;CN=One:mailto:[email protected]
DTSTART:20140716T120000Z
DTEND:20140716T130000Z
END:VEVENT
BEGIN:VEVENT
UID:foobar
SEQUENCE:1
SUMMARY:foo
RECURRENCE-ID:20140723T120000Z
ORGANIZER;CN=Strunk:mailto:[email protected]
ATTENDEE;CN=Strunk;PARTSTAT=ACCEPTED:mailto:[email protected]
DTSTART:20140723T120000Z
DTEND:20140723T130000Z
END:VEVENT
END:VCALENDAR
ICS;

$version = Version::VERSION;

$expected = [
[
'uid' => 'foobar',
'method' => 'REQUEST',
'component' => 'VEVENT',
'sender' => 'mailto:[email protected]',
'senderName' => 'Strunk',
'recipient' => 'mailto:[email protected]',
'recipientName' => 'One',
'significantChange' => true,
'message' => <<<ICS
BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//Sabre//Sabre VObject 4.5.6//EN
CALSCALE:GREGORIAN
METHOD:REQUEST
BEGIN:VEVENT
UID:foobar
SEQUENCE:1
SUMMARY:foo
RRULE:FREQ=WEEKLY
ORGANIZER;CN=Strunk:mailto:[email protected]
ATTENDEE;CN=Strunk;PARTSTAT=ACCEPTED:mailto:[email protected]
ATTENDEE;CN=One;PARTSTAT=NEEDS-ACTION:mailto:[email protected]
DTSTART:20140716T120000Z
DTEND:20140716T130000Z
EXDATE:20140723T120000Z
DTSTAMP:**ANY**
END:VEVENT
END:VCALENDAR
ICS,
],
];

$this->parse($oldMessage, $newMessage, $expected, 'mailto:[email protected]');
}
}
Loading