[Pkg-owncloud-commits] [php-sabre-vobject] 03/43: Respect SCHEDULE-AGENT on ORGANIZER.
David Prévot
taffit at moszumanska.debian.org
Fri Oct 10 14:16:14 UTC 2014
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch master
in repository php-sabre-vobject.
commit d12566a0533d8c41bd94b37cc65cc2e493993f9d
Author: Evert Pot <evert at rooftopsolutions.nl>
Date: Mon Sep 22 17:40:25 2014 +0100
Respect SCHEDULE-AGENT on ORGANIZER.
Fixes #143
---
ChangeLog.md | 1 +
lib/ITip/Broker.php | 10 +++++++
tests/VObject/ITip/BrokerAttendeeReplyTest.php | 36 ++++++++++++++++++++++++++
3 files changed, 47 insertions(+)
diff --git a/ChangeLog.md b/ChangeLog.md
index b164a28..a325157 100644
--- a/ChangeLog.md
+++ b/ChangeLog.md
@@ -6,6 +6,7 @@ ChangeLog
* #142: `CANCEL` and `REPLY` messages now include the `DTSTART` fromi the
original event.
+* #143: `SCHEDULE-AGENT` on the `ORGANIZER` property is respected.
3.3.2 (2014-09-19)
------------------
diff --git a/lib/ITip/Broker.php b/lib/ITip/Broker.php
index 91aab15..cdba2b0 100644
--- a/lib/ITip/Broker.php
+++ b/lib/ITip/Broker.php
@@ -619,6 +619,10 @@ class Broker {
*/
protected function parseEventForAttendee(VCalendar $calendar, array $eventInfo, array $oldEventInfo, $attendee) {
+ if ($this->scheduleAgentServerRules && $eventInfo['organizerScheduleAgent']==='CLIENT') {
+ return array();
+ }
+
// Don't bother generating messages for events that have already been
// cancelled.
if ($eventInfo['status']==='CANCELLED') {
@@ -775,6 +779,7 @@ class Broker {
$sequence = null;
$timezone = null;
$status = null;
+ $organizerScheduleAgent = 'SERVER';
$significantChangeHash = '';
@@ -812,6 +817,10 @@ class Broker {
isset($vevent->ORGANIZER['SCHEDULE-FORCE-SEND']) ?
strtoupper($vevent->ORGANIZER['SCHEDULE-FORCE-SEND']) :
null;
+ $organizerScheduleAgent =
+ isset($vevent->ORGANIZER['SCHEDULE-AGENT']) ?
+ strtoupper((string)$vevent->ORGANIZER['SCHEDULE-AGENT']) :
+ 'SERVER';
}
if (is_null($sequence) && isset($vevent->SEQUENCE)) {
$sequence = $vevent->SEQUENCE->getValue();
@@ -888,6 +897,7 @@ class Broker {
'uid',
'organizer',
'organizerName',
+ 'organizerScheduleAgent',
'organizerForceSend',
'instances',
'attendees',
diff --git a/tests/VObject/ITip/BrokerAttendeeReplyTest.php b/tests/VObject/ITip/BrokerAttendeeReplyTest.php
index 489af30..2045533 100644
--- a/tests/VObject/ITip/BrokerAttendeeReplyTest.php
+++ b/tests/VObject/ITip/BrokerAttendeeReplyTest.php
@@ -640,4 +640,40 @@ ICS;
}
+ function testScheduleAgentOnOrganizer() {
+
+ $oldMessage = <<<ICS
+BEGIN:VCALENDAR
+VERSION:2.0
+BEGIN:VEVENT
+UID:foobar
+SEQUENCE:1
+ORGANIZER;CN=Strunk:mailto:strunk at example.org
+ATTENDEE;CN=One:mailto:one at example.org
+DTSTART:20140716T120000Z
+END:VEVENT
+END:VCALENDAR
+ICS;
+
+
+ $newMessage = <<<ICS
+BEGIN:VCALENDAR
+VERSION:2.0
+BEGIN:VEVENT
+UID:foobar
+SEQUENCE:1
+ORGANIZER;SCHEDULE-AGENT=CLIENT;CN=Strunk:mailto:strunk at example.org
+ATTENDEE;PARTSTAT=ACCEPTED;CN=One:mailto:one at example.org
+DTSTART:20140716T120000Z
+END:VEVENT
+END:VCALENDAR
+ICS;
+
+ $version = \Sabre\VObject\Version::VERSION;
+
+ $expected = array();
+ $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