[Pkg-owncloud-commits] [php-sabre-vobject] 01/38: Updating RSVP status when a reply comes in.

David Prévot taffit at moszumanska.debian.org
Tue Sep 23 03:10:20 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 d6459e633bca7a3a6c8b65a5ec1cbfc724d14c1f
Author: Evert Pot <evert at rooftopsolutions.nl>
Date:   Sun Aug 24 17:39:58 2014 -0400

    Updating RSVP status when a reply comes in.
    
    Hopefully this fixes @DominikTo's bouncing event issue.
---
 ChangeLog.md                                  |  6 ++++
 lib/ITip/Broker.php                           |  8 +++++
 lib/Version.php                               |  2 +-
 tests/VObject/ITip/BrokerProcessReplyTest.php | 46 +++++++++++++++++++++++++++
 4 files changed, 61 insertions(+), 1 deletion(-)

diff --git a/ChangeLog.md b/ChangeLog.md
index a15b5f4..e34e6f7 100644
--- a/ChangeLog.md
+++ b/ChangeLog.md
@@ -1,6 +1,12 @@
 ChangeLog
 =========
 
+3.3.2 (2014-??-??)
+------------------
+
+* Changed: iTip broker now sets RSVP status to false when replies are received.
+
+
 3.3.1 (2014-08-18)
 ------------------
 
diff --git a/lib/ITip/Broker.php b/lib/ITip/Broker.php
index b8a6443..87e57e7 100644
--- a/lib/ITip/Broker.php
+++ b/lib/ITip/Broker.php
@@ -301,6 +301,8 @@ class Broker {
         }
         $instances = array();
         $requestStatus = '2.0;Success';
+
+        // Finding all the instances the attendee replied to.
         foreach($itipMessage->message->VEVENT as $vevent) {
             $recurId = isset($vevent->{'RECURRENCE-ID'})?$vevent->{'RECURRENCE-ID'}->getValue():'master';
             $attendee = $vevent->ATTENDEE;
@@ -309,6 +311,9 @@ class Broker {
                 $requestStatus = $vevent->{'REQUEST-STATUS'}->getValue();
             }
         }
+
+        // Now we need to loop through the original organizer event, to find
+        // all the instances where we have a reply for.
         $masterObject = null;
         foreach($existingObject->VEVENT as $vevent) {
             $recurId = isset($vevent->{'RECURRENCE-ID'})?$vevent->{'RECURRENCE-ID'}->getValue():'master';
@@ -323,6 +328,9 @@ class Broker {
                             $attendeeFound = true;
                             $attendee['PARTSTAT'] = $instances[$recurId];
                             $attendee['SCHEDULE-STATUS'] = $requestStatus;
+                            // Un-setting the RSVP status, because we now now
+                            // that the attende already replied.
+                            unset($attendee['RSVP']);
                             break;
                         }
                     }
diff --git a/lib/Version.php b/lib/Version.php
index 84721ef..1794f2c 100644
--- a/lib/Version.php
+++ b/lib/Version.php
@@ -14,6 +14,6 @@ class Version {
     /**
      * Full version number
      */
-    const VERSION = '3.3.1';
+    const VERSION = '3.3.2';
 
 }
diff --git a/tests/VObject/ITip/BrokerProcessReplyTest.php b/tests/VObject/ITip/BrokerProcessReplyTest.php
index 324191b..4812be9 100644
--- a/tests/VObject/ITip/BrokerProcessReplyTest.php
+++ b/tests/VObject/ITip/BrokerProcessReplyTest.php
@@ -378,5 +378,51 @@ ICS;
 
     }
 
+    /**
+     * @depends testReplyAccept
+     */
+    function testReplyAcceptUpdateRSVP() {
+
+        $itip = <<<ICS
+BEGIN:VCALENDAR
+VERSION:2.0
+METHOD:REPLY
+BEGIN:VEVENT
+ATTENDEE;PARTSTAT=ACCEPTED:mailto:foo at example.org
+ORGANIZER:mailto:bar at example.org
+SEQUENCE:2
+UID:foobar
+END:VEVENT
+END:VCALENDAR
+ICS;
+
+        $old = <<<ICS
+BEGIN:VCALENDAR
+VERSION:2.0
+BEGIN:VEVENT
+SEQUENCE:2
+UID:foobar
+ATTENDEE;RSVP=TRUE:mailto:foo at example.org
+ORGANIZER:mailto:bar at example.org
+END:VEVENT
+END:VCALENDAR
+ICS;
+
+        $expected = <<<ICS
+BEGIN:VCALENDAR
+VERSION:2.0
+BEGIN:VEVENT
+SEQUENCE:2
+UID:foobar
+ATTENDEE;PARTSTAT=ACCEPTED;SCHEDULE-STATUS="2.0;Success":mailto:foo at example
+ .org
+ORGANIZER:mailto:bar at example.org
+END:VEVENT
+END:VCALENDAR
+ICS;
+
+        $result = $this->process($itip, $old, $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