Skip to content

Commit

Permalink
Issue 462 - Broker::parseEventForOrganizer copies DTSTAMP from $… (#463)
Browse files Browse the repository at this point in the history
* Set DTSTAMP to NOW for iTip message in case of event update or cancellation
  • Loading branch information
Alexander Ivannikov authored and staabm committed Jul 10, 2019
1 parent da7c6f6 commit 21c2cff
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 2 deletions.
2 changes: 2 additions & 0 deletions lib/ITip/Broker.php
Original file line number Diff line number Diff line change
Expand Up @@ -522,6 +522,7 @@ protected function parseEventForOrganizer(VCalendar $calendar, array $eventInfo,
$event = $icalMsg->add('VEVENT', [
'UID' => $message->uid,
'SEQUENCE' => $message->sequence,
'DTSTAMP' => gmdate('Ymd\\THis\\Z'),
]);
if (isset($calendar->VEVENT->SUMMARY)) {
$event->add('SUMMARY', $calendar->VEVENT->SUMMARY->getValue());
Expand Down Expand Up @@ -607,6 +608,7 @@ protected function parseEventForOrganizer(VCalendar $calendar, array $eventInfo,
}
}

$currentEvent->DTSTAMP = gmdate('Ymd\\THis\\Z');
$icalMsg->add($currentEvent);
}
}
Expand Down
10 changes: 10 additions & 0 deletions tests/VObject/ITip/BrokerNewEventTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ public function testSimpleInvite()
DTEND:20140811T230000Z
ORGANIZER;CN=Strunk:mailto:[email protected]
ATTENDEE;CN=White;PARTSTAT=NEEDS-ACTION:mailto:[email protected]
DTSTAMP:**ANY**
END:VEVENT
END:VCALENDAR
ICS;
Expand Down Expand Up @@ -181,6 +182,7 @@ public function testRecurrenceInvite()
DURATION:PT1H
RRULE:FREQ=DAILY
EXDATE:20140717T120000Z,20140718T120000Z
DTSTAMP:**ANY**
END:VEVENT
END:VCALENDAR
ICS
Expand Down Expand Up @@ -208,6 +210,7 @@ public function testRecurrenceInvite()
DURATION:PT1H
RRULE:FREQ=DAILY
EXDATE:20140717T120000Z
DTSTAMP:**ANY**
END:VEVENT
BEGIN:VEVENT
UID:foobar
Expand All @@ -217,6 +220,7 @@ public function testRecurrenceInvite()
ATTENDEE;CN=Three:mailto:[email protected]
DTSTART:20140718T120000Z
DURATION:PT1H
DTSTAMP:**ANY**
END:VEVENT
END:VCALENDAR
ICS
Expand All @@ -243,6 +247,7 @@ public function testRecurrenceInvite()
ATTENDEE;CN=Three:mailto:[email protected]
DTSTART:20140718T120000Z
DURATION:PT1H
DTSTAMP:**ANY**
END:VEVENT
END:VCALENDAR
ICS
Expand Down Expand Up @@ -306,6 +311,7 @@ public function testRecurrenceInvite2()
DTEND:20140716T130000Z
RRULE:FREQ=DAILY
EXDATE:20140718T120000Z
DTSTAMP:**ANY**
END:VEVENT
END:VCALENDAR
ICS
Expand All @@ -332,6 +338,7 @@ public function testRecurrenceInvite2()
DTSTART:20140716T120000Z
DTEND:20140716T130000Z
RRULE:FREQ=DAILY
DTSTAMP:**ANY**
END:VEVENT
BEGIN:VEVENT
UID:foobar
Expand All @@ -341,6 +348,7 @@ public function testRecurrenceInvite2()
ATTENDEE;CN=Three:mailto:[email protected]
DTSTART:20140718T120000Z
DTEND:20140718T130000Z
DTSTAMP:**ANY**
END:VEVENT
END:VCALENDAR
ICS
Expand All @@ -367,6 +375,7 @@ public function testRecurrenceInvite2()
ATTENDEE;CN=Three:mailto:[email protected]
DTSTART:20140718T120000Z
DTEND:20140718T130000Z
DTSTAMP:**ANY**
END:VEVENT
END:VCALENDAR
ICS
Expand Down Expand Up @@ -417,6 +426,7 @@ public function testRecurrenceInvite3()
DTSTART:20140716T120000Z
DTEND:20140716T130000Z
RRULE:FREQ=WEEKLY;INTERVAL=2;COUNT=8;BYDAY=SA,SU
DTSTAMP:**ANY**
END:VEVENT
END:VCALENDAR
ICS
Expand Down
9 changes: 9 additions & 0 deletions tests/VObject/ITip/BrokerUpdateEventTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ public function testInviteChange()
ATTENDEE;CN=Three;PARTSTAT=NEEDS-ACTION:mailto:[email protected]
DTSTART:20140716T120000Z
DTEND:20140716T130000Z
DTSTAMP:**ANY**
END:VEVENT
END:VCALENDAR
ICS
Expand Down Expand Up @@ -125,6 +126,7 @@ public function testInviteChange()
ATTENDEE;CN=Three;PARTSTAT=NEEDS-ACTION:mailto:[email protected]
DTSTART:20140716T120000Z
DTEND:20140716T130000Z
DTSTAMP:**ANY**
END:VEVENT
END:VCALENDAR
ICS
Expand Down Expand Up @@ -186,6 +188,7 @@ public function testInviteChangeFromNonSchedulingToSchedulingObject()
ATTENDEE;CN=One;PARTSTAT=NEEDS-ACTION:mailto:[email protected]
DTSTART:20140716T120000Z
DTEND:20140716T130000Z
DTSTAMP:**ANY**
END:VEVENT
END:VCALENDAR
ICS
Expand Down Expand Up @@ -344,6 +347,7 @@ public function testRemoveInstance()
DTEND;TZID=America/Toronto:20140716T130000
RRULE:FREQ=WEEKLY
EXDATE;TZID=America/Toronto:20140724T120000
DTSTAMP:**ANY**
END:VEVENT
END:VCALENDAR
ICS
Expand Down Expand Up @@ -450,6 +454,7 @@ public function testInviteChangeSignificantChange()
ATTENDEE;CN=Three;PARTSTAT=NEEDS-ACTION:mailto:[email protected]
DTSTART:20140716T120000Z
DTEND:20140716T130000Z
DTSTAMP:**ANY**
END:VEVENT
END:VCALENDAR
ICS
Expand Down Expand Up @@ -479,6 +484,7 @@ public function testInviteChangeSignificantChange()
ATTENDEE;CN=Three;PARTSTAT=NEEDS-ACTION:mailto:[email protected]
DTSTART:20140716T120000Z
DTEND:20140716T130000Z
DTSTAMP:**ANY**
END:VEVENT
END:VCALENDAR
ICS
Expand Down Expand Up @@ -546,6 +552,7 @@ public function testInviteNoChange()
ATTENDEE;CN=One;PARTSTAT=NEEDS-ACTION:mailto:[email protected]
DTSTART:20140716T120000Z
DTEND:20140716T130000Z
DTSTAMP:**ANY**
END:VEVENT
END:VCALENDAR
ICS
Expand Down Expand Up @@ -613,6 +620,7 @@ public function testInviteNoChangeForceSend()
ATTENDEE;CN=One;PARTSTAT=NEEDS-ACTION:mailto:[email protected]
DTSTART:20140716T120000Z
DTEND:20140716T130000Z
DTSTAMP:**ANY**
END:VEVENT
END:VCALENDAR
ICS
Expand Down Expand Up @@ -797,6 +805,7 @@ public function testInviteChangeExdateOrder()
RRULE:FREQ=WEEKLY
EXDATE:20150101T160000Z
EXDATE:20150108T160000Z,20141225T160000Z
DTSTAMP:**ANY**
END:VEVENT
END:VCALENDAR
ICS
Expand Down
3 changes: 1 addition & 2 deletions tests/VObject/ITip/EvolutionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -844,7 +844,6 @@ public function testNewEvolutionEvent()
END:VTIMEZONE
BEGIN:VEVENT
UID:20140813T153116Z-12176-1000-1065-6@johnny-lubuntu
DTSTAMP:20140813T142829Z
DTSTART;TZID=/freeassociation.sourceforge.net/Tzfile/America/Toronto:201408
15T110000
DTEND;TZID=/freeassociation.sourceforge.net/Tzfile/America/Toronto:20140815
Expand Down Expand Up @@ -1701,7 +1700,6 @@ public function testNewEvolutionEvent()
END:VTIMEZONE
BEGIN:VEVENT
UID:20140813T153116Z-12176-1000-1065-6@johnny-lubuntu
DTSTAMP:20140813T142829Z
DTSTART;TZID=/freeassociation.sourceforge.net/Tzfile/America/Toronto:201408
15T110000
DTEND;TZID=/freeassociation.sourceforge.net/Tzfile/America/Toronto:20140815
Expand All @@ -1719,6 +1717,7 @@ public function testNewEvolutionEvent()
TRUE;LANGUAGE=en:MAILTO:[email protected]
CREATED:20140813T153211Z
LAST-MODIFIED:20140813T155353Z
DTSTAMP:**ANY**
END:VEVENT
END:VCALENDAR
ICS;
Expand Down

0 comments on commit 21c2cff

Please sign in to comment.