Add component parameter to content-types headers and getcontenttype properties

This allows clients to filter the results quickly by just looking at the content-type without having to parse the calendar data.
This commit is contained in:
Marten Gajda 2015-05-27 19:49:27 +02:00
parent 642524d391
commit f5dc6c669f
2 changed files with 2 additions and 1 deletions

View File

@ -274,6 +274,7 @@ class DAVResource
if ( isset($this->resource->summary) )$this->resource->displayname = $this->resource->summary;
if ( strtoupper(substr($this->resource->caldav_data,0,15)) == 'BEGIN:VCALENDAR' ) {
$this->contenttype = 'text/calendar';
if ( isset($this->resource->caldav_type) ) $this->contenttype .= "; component=" . strtolower($this->resource->caldav_type);
if ( !$this->HavePrivilegeTo('read') && $this->HavePrivilegeTo('read-free-busy') ) {
$vcal = new iCalComponent($this->resource->caldav_data);
$confidential = $vcal->CloneConfidential();

View File

@ -72,7 +72,7 @@ switch( $resource->caldav_type ) {
case 'VJOURNAL':
case 'VEVENT':
case 'VTODO':
$contenttype = 'text/calendar';
$contenttype = 'text/calendar; component=' . strtolower($resource->caldav_type);
break;
case 'VCARD':