From 7e1a5905ad31ca06c8f5650399efa57939c1d863 Mon Sep 17 00:00:00 2001 From: Andrew McMillan Date: Thu, 21 Jun 2012 22:00:23 +1200 Subject: [PATCH] Fix notification of deletes when hide_older_than is set. --- inc/caldav-REPORT-sync-collection.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/inc/caldav-REPORT-sync-collection.php b/inc/caldav-REPORT-sync-collection.php index 9a6d323e..6a6b67bd 100644 --- a/inc/caldav-REPORT-sync-collection.php +++ b/inc/caldav-REPORT-sync-collection.php @@ -81,9 +81,9 @@ if ( $sync_token == $new_token ) { } else { $hide_older = ''; - if ( isset($c->hide_older_than) && intval($c->hide_older_than > 0) ) - $hide_older = " AND (CASE WHEN caldav_data.caldav_type<>'VEVENT' THEN true ELSE calendar_item.dtstart > (now() - interval '".intval($c->hide_older_than)." days') END)"; - + if ( isset($c->hide_older_than) && intval($c->hide_older_than) > 0 ) + $hide_older = " AND (CASE WHEN caldav_data.caldav_type<>'VEVENT' OR calendar_item.dtstart IS NULL THEN true ELSE calendar_item.dtstart > (now() - interval '".intval($c->hide_older_than)." days') END)"; + if ( $sync_token == 0 ) { $sql = <<