Don't overwrite my participant status when updating an event from iTip

This commit is contained in:
Thomas Bruederli 2014-07-08 18:21:27 +02:00
parent 6f6eb81052
commit 3db5611180

View file

@ -2391,6 +2391,21 @@ class calendar extends rcube_plugin
$event['id'] = $existing['id'];
$event['calendar'] = $existing['calendar'];
// preserve my participant status for regular updates
if (empty($status)) {
$emails = $this->get_user_emails();
foreach ($event['attendees'] as $i => $attendee) {
if ($attendee['email'] && in_array(strtolower($attendee['email']), $emails)) {
foreach ($existing['attendees'] as $j => $_attendee) {
if ($attendee['email'] == $_attendee['email']) {
$event['attendees'][$i] = $existing['attendees'][$j];
break;
}
}
}
}
}
// set status=CANCELLED on CANCEL messages
if ($this->ical->method == 'CANCEL')
$event['status'] = 'CANCELLED';