From e4d77756e688123591fe86ac670007724963f078 Mon Sep 17 00:00:00 2001 From: Andrew McMillan Date: Mon, 12 Mar 2012 13:02:49 +1300 Subject: [PATCH] Add $c->auto_refresh_duration option to set a auto refresh on any GET calendar. --- inc/caldav-GET-functions.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/inc/caldav-GET-functions.php b/inc/caldav-GET-functions.php index ff2de5ce..ed2bc096 100644 --- a/inc/caldav-GET-functions.php +++ b/inc/caldav-GET-functions.php @@ -31,7 +31,7 @@ function obfuscated_event( $icalendar ) { } function export_iCalendar( DAVResource $dav_resource ) { - global $session; + global $session, $c; if ( ! $dav_resource->IsCalendar() && !(isset($c->get_includes_subcollections) && $c->get_includes_subcollections) ) { /** RFC2616 says we must send an Allow header if we send a 405 */ header("Allow: PROPFIND,PROPPATCH,OPTIONS,MKCOL,REPORT,DELETE"); @@ -70,7 +70,11 @@ function export_iCalendar( DAVResource $dav_resource ) { if ( isset($displayname) ) { $vcal->AddProperty("X-WR-CALNAME", $displayname); } - + if ( !empty($c->auto_refresh_duration) ) { + $vcal->AddProperty("X-APPLE-AUTO-REFRESH-INTERVAL", $c->auto_refresh_duration); + $vcal->AddProperty("AUTO-REFRESH", $c->auto_refresh_duration); + } + $need_zones = array(); $timezones = array(); while( $event = $qry->Fetch() ) {