[Pkg-owncloud-commits] [php-sabre-vobject] 19/43: Fix for #148.

David Prévot taffit at moszumanska.debian.org
Fri Oct 10 14:16:15 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 7ddd53c83a810eb7961785ed16cd308e4b861a22
Author: Evert Pot <evert at rooftopsolutions.nl>
Date:   Sun Sep 28 15:50:48 2014 +0100

    Fix for #148.
---
 ChangeLog.md                              |  1 +
 lib/ITip/Broker.php                       |  5 +++++
 tests/VObject/ITip/BrokerNewEventTest.php | 16 ++++++++++++++++
 3 files changed, 22 insertions(+)

diff --git a/ChangeLog.md b/ChangeLog.md
index aaf914e..69d8a47 100644
--- a/ChangeLog.md
+++ b/ChangeLog.md
@@ -10,6 +10,7 @@ ChangeLog
 * #144: `PARTSTAT=NEEDS-ACTION` is now set for new invites, if no `PARTSTAT` is
   set to support the inbox feature of iOS.
 * #147: Bugs related to scheduling all-day events.
+* #148: Ignore events that have attendees but no organizer.
 
 3.3.2 (2014-09-19)
 ------------------
diff --git a/lib/ITip/Broker.php b/lib/ITip/Broker.php
index 54a334a..73534b6 100644
--- a/lib/ITip/Broker.php
+++ b/lib/ITip/Broker.php
@@ -178,6 +178,7 @@ class Broker {
             $oldEventInfo = $this->parseEventInfo($oldCalendar);
         } else {
             $oldEventInfo = array(
+                'organizer' => null,
                 'significantChangeHash' => '',
                 'attendees' => array(),
             );
@@ -200,6 +201,10 @@ class Broker {
                 // we don't need to do anything.
                 return array();
             }
+            if (!$eventInfo['organizer'] && !$oldEventInfo['organizer']) {
+                // There was no organizer before or after the change.
+                return array();
+            }
 
             $baseCalendar = $calendar;
 
diff --git a/tests/VObject/ITip/BrokerNewEventTest.php b/tests/VObject/ITip/BrokerNewEventTest.php
index 06b68cc..f4853c5 100644
--- a/tests/VObject/ITip/BrokerNewEventTest.php
+++ b/tests/VObject/ITip/BrokerNewEventTest.php
@@ -460,6 +460,22 @@ ICS;
         $result = $this->parse($message, array());
 
     }
+    function testNoOrganizerHasAttendee() {
+
+        $message = <<<ICS
+BEGIN:VCALENDAR
+BEGIN:VEVENT
+UID:foobar
+DTSTART:20140811T220000Z
+ATTENDEE;CN=Two:mailto:two at example.org
+END:VEVENT
+END:VCALENDAR
+ICS;
+
+        $this->parse($message, array());
+
+    }
+
     function parse($message, $expected = array()) {
 
         $broker = new Broker();

-- 
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