[Pkg-owncloud-commits] [php-sabre-vobject] 35/38: Send CANCEL messages when ORGANIZER property gets deleted.
David Prévot
taffit at moszumanska.debian.org
Tue Sep 23 03:10:24 UTC 2014
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch upstream
in repository php-sabre-vobject.
commit ce6dc1a65a421657eb9ccdbc5650628443d21232
Author: Evert Pot <evert at rooftopsolutions.nl>
Date: Fri Sep 19 18:08:45 2014 +0100
Send CANCEL messages when ORGANIZER property gets deleted.
Fixes #125
---
ChangeLog.md | 1 +
lib/ITip/Broker.php | 8 +++
tests/VObject/ITip/BrokerUpdateEventTest.php | 91 ++++++++++++++++++++++++++++
3 files changed, 100 insertions(+)
diff --git a/ChangeLog.md b/ChangeLog.md
index 03a9008..8bfc27e 100644
--- a/ChangeLog.md
+++ b/ChangeLog.md
@@ -20,6 +20,7 @@ ChangeLog
objects.
* #127: Attendees who delete recurring event instances events they had already
declined earlier will no longer generate another reply.
+* #125: Send CANCEL messages when ORGANIZER property gets deleted.
3.3.1 (2014-08-18)
------------------
diff --git a/lib/ITip/Broker.php b/lib/ITip/Broker.php
index 134e8d3..828dd7c 100644
--- a/lib/ITip/Broker.php
+++ b/lib/ITip/Broker.php
@@ -203,6 +203,14 @@ class Broker {
$baseCalendar = $calendar;
+ // If the new object didn't have an organizer, the origanizer
+ // changed the object from a scheduling object to a non-scheduling
+ // object. We just copy the info from the old object.
+ if (!$eventInfo['organizer'] && $oldEventInfo['organizer']) {
+ $eventInfo['organizer'] = $oldEventInfo['organizer'];
+ $eventInfo['organizerName'] = $oldEventInfo['organizerName'];
+ }
+
} else {
// The calendar object got deleted, we need to process this as a
// cancellation / decline.
diff --git a/tests/VObject/ITip/BrokerUpdateEventTest.php b/tests/VObject/ITip/BrokerUpdateEventTest.php
index 6dd96f6..ca2d321 100644
--- a/tests/VObject/ITip/BrokerUpdateEventTest.php
+++ b/tests/VObject/ITip/BrokerUpdateEventTest.php
@@ -591,4 +591,95 @@ ICS
}
+ function testInviteRemoveAttendees() {
+
+ $oldMessage = <<<ICS
+BEGIN:VCALENDAR
+VERSION:2.0
+BEGIN:VEVENT
+UID:foobar
+SEQUENCE:1
+SUMMARY:foo
+ORGANIZER;CN=Strunk:mailto:strunk at example.org
+ATTENDEE;CN=Strunk:mailto:strunk at example.org
+ATTENDEE;CN=One:mailto:one at example.org
+ATTENDEE;CN=Two:mailto:two at example.org
+DTSTART:20140716T120000Z
+END:VEVENT
+END:VCALENDAR
+ICS;
+
+
+ $newMessage = <<<ICS
+BEGIN:VCALENDAR
+VERSION:2.0
+BEGIN:VEVENT
+UID:foobar
+SEQUENCE:2
+SUMMARY:foo
+DTSTART:20140716T120000Z
+END:VEVENT
+END:VCALENDAR
+ICS;
+
+ $version = \Sabre\VObject\Version::VERSION;
+
+ $expected = array(
+ array(
+ 'uid' => 'foobar',
+ 'method' => 'CANCEL',
+ 'component' => 'VEVENT',
+ 'sender' => 'mailto:strunk at example.org',
+ 'senderName' => 'Strunk',
+ 'recipient' => 'mailto:one at example.org',
+ 'recipientName' => 'One',
+ 'significantChange' => true,
+ 'message' => <<<ICS
+BEGIN:VCALENDAR
+VERSION:2.0
+PRODID:-//Sabre//Sabre VObject $version//EN
+CALSCALE:GREGORIAN
+METHOD:CANCEL
+BEGIN:VEVENT
+UID:foobar
+SEQUENCE:2
+SUMMARY:foo
+ORGANIZER;CN=Strunk:mailto:strunk at example.org
+ATTENDEE;CN=One:mailto:one at example.org
+END:VEVENT
+END:VCALENDAR
+ICS
+
+ ),
+ array(
+ 'uid' => 'foobar',
+ 'method' => 'CANCEL',
+ 'component' => 'VEVENT',
+ 'sender' => 'mailto:strunk at example.org',
+ 'senderName' => 'Strunk',
+ 'recipient' => 'mailto:two at example.org',
+ 'recipientName' => 'Two',
+ 'significantChange' => true,
+ 'message' => <<<ICS
+BEGIN:VCALENDAR
+VERSION:2.0
+PRODID:-//Sabre//Sabre VObject $version//EN
+CALSCALE:GREGORIAN
+METHOD:CANCEL
+BEGIN:VEVENT
+UID:foobar
+SEQUENCE:2
+SUMMARY:foo
+ORGANIZER;CN=Strunk:mailto:strunk at example.org
+ATTENDEE;CN=Two:mailto:two at example.org
+END:VEVENT
+END:VCALENDAR
+ICS
+
+ ),
+ );
+
+ $result = $this->parse($oldMessage, $newMessage, $expected);
+
+ }
}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/php-sabre-vobject.git
More information about the Pkg-owncloud-commits
mailing list