From 42736c833c0bc1c484dccd09ea65d444a0248bef Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Mon, 6 Aug 2018 18:15:36 +0200 Subject: [PATCH] * CalDAV/Calendar: dealing with Thunderbird setting partipant status on organizer If secritary creates an event in the owners calendar the owner/organizer is on status NEEDS-ACTION. Accepting that event in Thunderbird set PARTSTAT=ACCEPTED on ORGANIZER, while ATTENDEE is still on PARTSTAT=NEEDS-ACTION. In that case prefer the PARTSTAT from ORGANIZER over ATTENDEE. In my opionion Thunderbird behavior is wrong, thought that fix does not do any other harm, as no other client sets PARTSTAT in ORGANIZER. --- calendar/inc/class.calendar_ical.inc.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/calendar/inc/class.calendar_ical.inc.php b/calendar/inc/class.calendar_ical.inc.php index 0708988722..8de37b0df9 100644 --- a/calendar/inc/class.calendar_ical.inc.php +++ b/calendar/inc/class.calendar_ical.inc.php @@ -585,7 +585,7 @@ class calendar_ical extends calendar_boupdate if (!empty($event['owner'])) $options['X-EGROUPWARE-UID'] = $event['owner']; $attributes['ATTENDEE'][] = $organizerURL; $parameters['ATTENDEE'][] = $options; - } + } } // do NOT use ORGANIZER for events without further participants or a different organizer if (count($event['participants']) > 1 || !isset($event['participants'][$event['owner']])) @@ -2488,6 +2488,7 @@ class calendar_ical extends calendar_boupdate $isDate = false; $event = array(); $alarms = array(); + $organizer_status = $organizer_uid = null; $vcardData = array( 'recur_type' => MCAL_RECUR_NONE, 'recur_exception' => array(), @@ -3056,7 +3057,11 @@ class calendar_ical extends calendar_boupdate // for multiple entries the ACCEPT wins // add quantity and role $vcardData['participants'][$uid] = - calendar_so::combine_status($status, $quantity, $role); + calendar_so::combine_status( + // Thunderbird: if there is a PARTICIPANT for the ORGANIZER AND ORGANZIER has PARTSTAT + // --> use the one from ORGANIZER + $uid === $organizer_uid && !empty($organizer_status) && $organizer_status !== 'X' ? + $organizer_status : $status, $quantity, $role); try { if (!$this->calendarOwner && is_numeric($uid) && $role == 'CHAIR') @@ -3071,6 +3076,9 @@ class calendar_ical extends calendar_boupdate break; case 'ORGANIZER': + // remember evtl. set PARTSTAT from ORGANIZER, as TB sets it on ORGANIZER not PARTICIPANT! + $organizer_uid = $uid; + $organizer_status = $status; if (isset($vcardData['participants'][$uid])) { $status = $vcardData['participants'][$uid];