From 5384d175e9c1ce0bbd5da3ad5ddaa852a648b813 Mon Sep 17 00:00:00 2001 From: Andrew McMillan Date: Wed, 3 Feb 2010 10:40:05 -0800 Subject: [PATCH] Well, it seems webdav-sync needs to change to always report delete. This will become part of the spec in the next revision. --- inc/caldav-REPORT-sync-collection.php | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/inc/caldav-REPORT-sync-collection.php b/inc/caldav-REPORT-sync-collection.php index a823f1d9..e258339a 100644 --- a/inc/caldav-REPORT-sync-collection.php +++ b/inc/caldav-REPORT-sync-collection.php @@ -72,20 +72,13 @@ if ( $qry->Exec("REPORT",__LINE__,__FILE__) ) { if ( $object->dav_name == $last_dav_name ) { /** The complex case: this is the second or subsequent for this dav_id */ if ( $object->sync_status == 404 ) { - if ( $first_status == 201 ) { - array_pop($responses); - $last_dav_name = ''; - $first_status = 0; - } - else { - array_pop($responses); - $resultset = array( - new XMLElement( 'href', ConstructURL($object->dav_name) ), - new XMLElement( 'status', display_status($object->sync_status) ) - ); - $responses[] = new XMLElement( 'sync-response', $resultset ); - $first_status = 404; - } + array_pop($responses); + $resultset = array( + new XMLElement( 'href', ConstructURL($object->dav_name) ), + new XMLElement( 'status', display_status($object->sync_status) ) + ); + $responses[] = new XMLElement( 'sync-response', $resultset ); + $first_status = 404; } else if ( $object->sync_status == 201 && $first_status == 404 ) { // ... Delete ... Create ... is indicated as a create, but don't forget we started with a delete