[Pkg-owncloud-commits] [php-sabredav] 34/42: Removing SCHEDULE-STATUS in some cases.

David Prévot taffit at moszumanska.debian.org
Wed Oct 29 20:52:07 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository php-sabredav.

commit 61394a8d41cc45189ab62a717c716f7847b418df
Author: Evert Pot <me at evertpot.com>
Date:   Thu Oct 23 21:27:15 2014 -0400

    Removing SCHEDULE-STATUS in some cases.
    
    When an iCalendar change is deemed 'insignificant' and no iTip delivery
    system sent a message, or an error was triggered, the schedule-status
    simply gets removed.
---
 lib/CalDAV/Schedule/Plugin.php | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/lib/CalDAV/Schedule/Plugin.php b/lib/CalDAV/Schedule/Plugin.php
index 51e6ff1..3f76e34 100644
--- a/lib/CalDAV/Schedule/Plugin.php
+++ b/lib/CalDAV/Schedule/Plugin.php
@@ -310,6 +310,12 @@ class Plugin extends ServerPlugin {
         if (!$iTipMessage->scheduleStatus) {
             $iTipMessage->scheduleStatus='5.2;There was no system capable of delivering the scheduling message';
         }
+        // In case the change was considered 'insignificant', we are going to
+        // remove any error statuses, if any. See ticket #525.
+        list($baseCode) = explode('.', $iTipMessage->scheduleStatus);
+        if (!$iTipMessage->significantChange && in_array($baseCode,['3','5'])) {
+            $iTipMessage->scheduleStatus = null;
+        }
 
     }
 
@@ -521,7 +527,9 @@ class Plugin extends ServerPlugin {
             $this->deliver($message);
 
             if (isset($newObject->VEVENT->ORGANIZER) && ($newObject->VEVENT->ORGANIZER->getNormalizedValue() === $message->recipient)) {
-                $newObject->VEVENT->ORGANIZER['SCHEDULE-STATUS'] = $message->scheduleStatus;
+                if ($message->scheduleStatus) {
+                    $newObject->VEVENT->ORGANIZER['SCHEDULE-STATUS'] = $message->scheduleStatus;
+                }
                 unset($newObject->VEVENT->ORGANIZER['SCHEDULE-FORCE-SEND']);
 
             } else {
@@ -529,7 +537,9 @@ class Plugin extends ServerPlugin {
                 if (isset($newObject->VEVENT->ATTENDEE)) foreach($newObject->VEVENT->ATTENDEE as $attendee) {
 
                     if ($attendee->getNormalizedValue() === $message->recipient) {
-                        $attendee['SCHEDULE-STATUS'] = $message->scheduleStatus;
+                        if ($message->scheduleStatus) {
+                            $attendee['SCHEDULE-STATUS'] = $message->scheduleStatus;
+                        }
                         unset($attendee['SCHEDULE-FORCE-SEND']);
                         break;
                     }

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/php-sabredav.git



More information about the Pkg-owncloud-commits mailing list