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).
This commit is contained in:
Aleksander Machniak 2019-04-25 10:04:55 +00:00
parent d852838c7e
commit 1d72a95549

View file

@ -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';