From 1d72a95549bc33a4f713eaa0ce79f3b2cee45000 Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Thu, 25 Apr 2019 10:04:55 +0000 Subject: [PATCH] On iTip request fallback to attendee status, not organizer's When a user has delegator's identities defined and receives an iTip requests from the delegator (as an organizer) that invitation could have been detected as accepted (even if there obviously was no event in users calendar and the status is needs-action/unknown). --- .../lib/libcalendaring_itip.php | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/plugins/libcalendaring/lib/libcalendaring_itip.php b/plugins/libcalendaring/lib/libcalendaring_itip.php index 68e6a139..42b6106d 100644 --- a/plugins/libcalendaring/lib/libcalendaring_itip.php +++ b/plugins/libcalendaring/lib/libcalendaring_itip.php @@ -707,14 +707,14 @@ class libcalendaring_itip // add button to open calendar/preview if (!empty($preview_url)) { - $msgref = $this->lib->ical_message->folder . '/' . $this->lib->ical_message->uid . '#' . $mime_id; - $rsvp_buttons .= html::tag('input', array( - 'type' => 'button', - // TODO: Temp. disable this button on small screen in Elastic (Bifrost#T105747) - 'class' => "button preview hidden-phone hidden-small", - 'onclick' => "rcube_libcalendaring.open_itip_preview('" . rcube::JQ($preview_url) . "', '" . rcube::JQ($msgref) . "')", - 'value' => $this->gettext('openpreview'), - )); + $msgref = $this->lib->ical_message->folder . '/' . $this->lib->ical_message->uid . '#' . $mime_id; + $rsvp_buttons .= html::tag('input', array( + 'type' => 'button', + // TODO: Temp. disable this button on small screen in Elastic (Bifrost#T105747) + 'class' => "button preview hidden-phone hidden-small", + 'onclick' => "rcube_libcalendaring.open_itip_preview('" . rcube::JQ($preview_url) . "', '" . rcube::JQ($msgref) . "')", + 'value' => $this->gettext('openpreview'), + )); } // 2. update the local copy with minor changes @@ -733,9 +733,9 @@ class libcalendaring_itip 'value' => $this->gettext('importtocalendar'), )); - // check my status + // check my status as an attendee foreach ($event['attendees'] as $attendee) { - if ($attendee['email'] && in_array(strtolower($attendee['email']), $emails)) { + if ($attendee['email'] && $attendee['role'] != 'ORGANIZER' && in_array(strtolower($attendee['email']), $emails)) { $metadata['attendee'] = $attendee['email']; $metadata['rsvp'] = $attendee['rsvp'] || $attendee['role'] != 'NON-PARTICIPANT'; $rsvp_status = !empty($attendee['status']) ? strtoupper($attendee['status']) : 'NEEDS-ACTION';