mirror of
https://gitlab.com/davical-project/davical.git
synced 2026-05-18 01:31:21 +00:00
Put some workarounds in for Apple iCal.
This commit is contained in:
parent
79bd7e2097
commit
ecea83fb03
@ -40,9 +40,18 @@ function handle_freebusy_request( $ic ) {
|
|||||||
$fbq_end = $ic->Get('DTEND');
|
$fbq_end = $ic->Get('DTEND');
|
||||||
$component =& $ic->component->FirstNonTimezone();
|
$component =& $ic->component->FirstNonTimezone();
|
||||||
$attendees = $component->GetProperties('ATTENDEE');
|
$attendees = $component->GetProperties('ATTENDEE');
|
||||||
|
if ( preg_match( '# iCal/\d#', $_SERVER['HTTP_USER_AGENT']) ) {
|
||||||
|
dbg_error_log( "POST", "Non-compliant iCal request. Using X-WR-ATTENDEE property" );
|
||||||
|
$wr_attendees = $component->GetProperties('X-WR-ATTENDEE');
|
||||||
|
foreach( $wr_attendees AS $k => $v ) {
|
||||||
|
$attendees[] = $v;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
dbg_error_log( "POST", "Responding with free/busy for %d attendees", count($attendees) );
|
||||||
|
|
||||||
foreach( $attendees AS $k => $attendee ) {
|
foreach( $attendees AS $k => $attendee ) {
|
||||||
$attendee_email = preg_replace( '/^mailto:/', '', $attendee->Value() );
|
$attendee_email = preg_replace( '/^mailto:/', '', $attendee->Value() );
|
||||||
|
dbg_error_log( "POST", "Calculating free/busy for %s", $attendee_email );
|
||||||
if ( ! ( isset($fbq_start) || isset($fbq_end) ) ) {
|
if ( ! ( isset($fbq_start) || isset($fbq_end) ) ) {
|
||||||
$request->DoResponse( 400, 'All valid freebusy requests MUST contain a DTSTART and a DTEND' );
|
$request->DoResponse( 400, 'All valid freebusy requests MUST contain a DTSTART and a DTEND' );
|
||||||
}
|
}
|
||||||
@ -160,10 +169,10 @@ $calendar_properties = $ical->component->GetProperties('METHOD');
|
|||||||
$method = $calendar_properties[0]->Value();
|
$method = $calendar_properties[0]->Value();
|
||||||
switch ( $method ) {
|
switch ( $method ) {
|
||||||
case 'REQUEST':
|
case 'REQUEST':
|
||||||
dbg_error_log("POST", ": Handling iTIP 'REQUEST' method.", $method );
|
dbg_error_log("POST", "Handling iTIP 'REQUEST' method.", $method );
|
||||||
handle_freebusy_request( $ical );
|
handle_freebusy_request( $ical );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
dbg_error_log("POST", ": Unhandled '%s' method in request.", $method );
|
dbg_error_log("POST", "Unhandled '%s' method in request.", $method );
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user