Send CANCEL iTip notifications for removed (uninvited) attendees
This commit is contained in:
parent
e4a2697515
commit
1c56c2c44c
1 changed files with 18 additions and 4 deletions
|
@ -1673,8 +1673,10 @@ class calendar extends rcube_plugin
|
||||||
}
|
}
|
||||||
|
|
||||||
// send to every attendee
|
// send to every attendee
|
||||||
$sent = 0;
|
$sent = 0; $current = array();
|
||||||
foreach ((array)$event['attendees'] as $attendee) {
|
foreach ((array)$event['attendees'] as $attendee) {
|
||||||
|
$current[] = $attendee['email'];
|
||||||
|
|
||||||
// skip myself for obvious reasons
|
// skip myself for obvious reasons
|
||||||
if (!$attendee['email'] || in_array(strtolower($attendee['email']), $emails))
|
if (!$attendee['email'] || in_array(strtolower($attendee['email']), $emails))
|
||||||
continue;
|
continue;
|
||||||
|
@ -1691,7 +1693,19 @@ class calendar extends rcube_plugin
|
||||||
$sent = -100;
|
$sent = -100;
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: send CANCEL message to remove attendees
|
// send CANCEL message to removed attendees
|
||||||
|
foreach ((array)$old['attendees'] as $attendee) {
|
||||||
|
if ($attendee['ROLE'] == 'ORGANIZER' || !$attendee['email'] || in_array(strtolower($attendee['email']), $current))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
$vevent = $old;
|
||||||
|
$vevent['cancelled'] = $is_cancelled;
|
||||||
|
$vevent['attendees'] = array($attendee);
|
||||||
|
if ($itip->send_itip_message($vevent, 'CANCEL', $attendee, 'eventcancelsubject', 'eventcancelmailbody'))
|
||||||
|
$sent++;
|
||||||
|
else
|
||||||
|
$sent = -100;
|
||||||
|
}
|
||||||
|
|
||||||
return $sent;
|
return $sent;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue