Skip to content

Commit 21c2cff

Browse files
Alexander Ivannikovstaabm
authored andcommitted
Issue 462 - Broker::parseEventForOrganizer copies DTSTAMP from $… (#463)
* Set DTSTAMP to NOW for iTip message in case of event update or cancellation
1 parent da7c6f6 commit 21c2cff

File tree

4 files changed

+22
-2
lines changed

4 files changed

+22
-2
lines changed

lib/ITip/Broker.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -522,6 +522,7 @@ protected function parseEventForOrganizer(VCalendar $calendar, array $eventInfo,
522522
$event = $icalMsg->add('VEVENT', [
523523
'UID' => $message->uid,
524524
'SEQUENCE' => $message->sequence,
525+
'DTSTAMP' => gmdate('Ymd\\THis\\Z'),
525526
]);
526527
if (isset($calendar->VEVENT->SUMMARY)) {
527528
$event->add('SUMMARY', $calendar->VEVENT->SUMMARY->getValue());
@@ -607,6 +608,7 @@ protected function parseEventForOrganizer(VCalendar $calendar, array $eventInfo,
607608
}
608609
}
609610

611+
$currentEvent->DTSTAMP = gmdate('Ymd\\THis\\Z');
610612
$icalMsg->add($currentEvent);
611613
}
612614
}

tests/VObject/ITip/BrokerNewEventTest.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ public function testSimpleInvite()
6060
DTEND:20140811T230000Z
6161
ORGANIZER;CN=Strunk:mailto:[email protected]
6262
ATTENDEE;CN=White;PARTSTAT=NEEDS-ACTION:mailto:[email protected]
63+
DTSTAMP:**ANY**
6364
END:VEVENT
6465
END:VCALENDAR
6566
ICS;
@@ -181,6 +182,7 @@ public function testRecurrenceInvite()
181182
DURATION:PT1H
182183
RRULE:FREQ=DAILY
183184
EXDATE:20140717T120000Z,20140718T120000Z
185+
DTSTAMP:**ANY**
184186
END:VEVENT
185187
END:VCALENDAR
186188
ICS
@@ -208,6 +210,7 @@ public function testRecurrenceInvite()
208210
DURATION:PT1H
209211
RRULE:FREQ=DAILY
210212
EXDATE:20140717T120000Z
213+
DTSTAMP:**ANY**
211214
END:VEVENT
212215
BEGIN:VEVENT
213216
UID:foobar
@@ -217,6 +220,7 @@ public function testRecurrenceInvite()
217220
ATTENDEE;CN=Three:mailto:[email protected]
218221
DTSTART:20140718T120000Z
219222
DURATION:PT1H
223+
DTSTAMP:**ANY**
220224
END:VEVENT
221225
END:VCALENDAR
222226
ICS
@@ -243,6 +247,7 @@ public function testRecurrenceInvite()
243247
ATTENDEE;CN=Three:mailto:[email protected]
244248
DTSTART:20140718T120000Z
245249
DURATION:PT1H
250+
DTSTAMP:**ANY**
246251
END:VEVENT
247252
END:VCALENDAR
248253
ICS
@@ -306,6 +311,7 @@ public function testRecurrenceInvite2()
306311
DTEND:20140716T130000Z
307312
RRULE:FREQ=DAILY
308313
EXDATE:20140718T120000Z
314+
DTSTAMP:**ANY**
309315
END:VEVENT
310316
END:VCALENDAR
311317
ICS
@@ -332,6 +338,7 @@ public function testRecurrenceInvite2()
332338
DTSTART:20140716T120000Z
333339
DTEND:20140716T130000Z
334340
RRULE:FREQ=DAILY
341+
DTSTAMP:**ANY**
335342
END:VEVENT
336343
BEGIN:VEVENT
337344
UID:foobar
@@ -341,6 +348,7 @@ public function testRecurrenceInvite2()
341348
ATTENDEE;CN=Three:mailto:[email protected]
342349
DTSTART:20140718T120000Z
343350
DTEND:20140718T130000Z
351+
DTSTAMP:**ANY**
344352
END:VEVENT
345353
END:VCALENDAR
346354
ICS
@@ -367,6 +375,7 @@ public function testRecurrenceInvite2()
367375
ATTENDEE;CN=Three:mailto:[email protected]
368376
DTSTART:20140718T120000Z
369377
DTEND:20140718T130000Z
378+
DTSTAMP:**ANY**
370379
END:VEVENT
371380
END:VCALENDAR
372381
ICS
@@ -417,6 +426,7 @@ public function testRecurrenceInvite3()
417426
DTSTART:20140716T120000Z
418427
DTEND:20140716T130000Z
419428
RRULE:FREQ=WEEKLY;INTERVAL=2;COUNT=8;BYDAY=SA,SU
429+
DTSTAMP:**ANY**
420430
END:VEVENT
421431
END:VCALENDAR
422432
ICS

tests/VObject/ITip/BrokerUpdateEventTest.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ public function testInviteChange()
9696
ATTENDEE;CN=Three;PARTSTAT=NEEDS-ACTION:mailto:[email protected]
9797
DTSTART:20140716T120000Z
9898
DTEND:20140716T130000Z
99+
DTSTAMP:**ANY**
99100
END:VEVENT
100101
END:VCALENDAR
101102
ICS
@@ -125,6 +126,7 @@ public function testInviteChange()
125126
ATTENDEE;CN=Three;PARTSTAT=NEEDS-ACTION:mailto:[email protected]
126127
DTSTART:20140716T120000Z
127128
DTEND:20140716T130000Z
129+
DTSTAMP:**ANY**
128130
END:VEVENT
129131
END:VCALENDAR
130132
ICS
@@ -186,6 +188,7 @@ public function testInviteChangeFromNonSchedulingToSchedulingObject()
186188
ATTENDEE;CN=One;PARTSTAT=NEEDS-ACTION:mailto:[email protected]
187189
DTSTART:20140716T120000Z
188190
DTEND:20140716T130000Z
191+
DTSTAMP:**ANY**
189192
END:VEVENT
190193
END:VCALENDAR
191194
ICS
@@ -344,6 +347,7 @@ public function testRemoveInstance()
344347
DTEND;TZID=America/Toronto:20140716T130000
345348
RRULE:FREQ=WEEKLY
346349
EXDATE;TZID=America/Toronto:20140724T120000
350+
DTSTAMP:**ANY**
347351
END:VEVENT
348352
END:VCALENDAR
349353
ICS
@@ -450,6 +454,7 @@ public function testInviteChangeSignificantChange()
450454
ATTENDEE;CN=Three;PARTSTAT=NEEDS-ACTION:mailto:[email protected]
451455
DTSTART:20140716T120000Z
452456
DTEND:20140716T130000Z
457+
DTSTAMP:**ANY**
453458
END:VEVENT
454459
END:VCALENDAR
455460
ICS
@@ -479,6 +484,7 @@ public function testInviteChangeSignificantChange()
479484
ATTENDEE;CN=Three;PARTSTAT=NEEDS-ACTION:mailto:[email protected]
480485
DTSTART:20140716T120000Z
481486
DTEND:20140716T130000Z
487+
DTSTAMP:**ANY**
482488
END:VEVENT
483489
END:VCALENDAR
484490
ICS
@@ -546,6 +552,7 @@ public function testInviteNoChange()
546552
ATTENDEE;CN=One;PARTSTAT=NEEDS-ACTION:mailto:[email protected]
547553
DTSTART:20140716T120000Z
548554
DTEND:20140716T130000Z
555+
DTSTAMP:**ANY**
549556
END:VEVENT
550557
END:VCALENDAR
551558
ICS
@@ -613,6 +620,7 @@ public function testInviteNoChangeForceSend()
613620
ATTENDEE;CN=One;PARTSTAT=NEEDS-ACTION:mailto:[email protected]
614621
DTSTART:20140716T120000Z
615622
DTEND:20140716T130000Z
623+
DTSTAMP:**ANY**
616624
END:VEVENT
617625
END:VCALENDAR
618626
ICS
@@ -797,6 +805,7 @@ public function testInviteChangeExdateOrder()
797805
RRULE:FREQ=WEEKLY
798806
EXDATE:20150101T160000Z
799807
EXDATE:20150108T160000Z,20141225T160000Z
808+
DTSTAMP:**ANY**
800809
END:VEVENT
801810
END:VCALENDAR
802811
ICS

tests/VObject/ITip/EvolutionTest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -844,7 +844,6 @@ public function testNewEvolutionEvent()
844844
END:VTIMEZONE
845845
BEGIN:VEVENT
846846
UID:20140813T153116Z-12176-1000-1065-6@johnny-lubuntu
847-
DTSTAMP:20140813T142829Z
848847
DTSTART;TZID=/freeassociation.sourceforge.net/Tzfile/America/Toronto:201408
849848
15T110000
850849
DTEND;TZID=/freeassociation.sourceforge.net/Tzfile/America/Toronto:20140815
@@ -1701,7 +1700,6 @@ public function testNewEvolutionEvent()
17011700
END:VTIMEZONE
17021701
BEGIN:VEVENT
17031702
UID:20140813T153116Z-12176-1000-1065-6@johnny-lubuntu
1704-
DTSTAMP:20140813T142829Z
17051703
DTSTART;TZID=/freeassociation.sourceforge.net/Tzfile/America/Toronto:201408
17061704
15T110000
17071705
DTEND;TZID=/freeassociation.sourceforge.net/Tzfile/America/Toronto:20140815
@@ -1719,6 +1717,7 @@ public function testNewEvolutionEvent()
17191717
TRUE;LANGUAGE=en:MAILTO:[email protected]
17201718
CREATED:20140813T153211Z
17211719
LAST-MODIFIED:20140813T155353Z
1720+
DTSTAMP:**ANY**
17221721
END:VEVENT
17231722
END:VCALENDAR
17241723
ICS;

0 commit comments

Comments
 (0)