diff --git a/plugins/calendar/calendar.php b/plugins/calendar/calendar.php index f6079db1..b67d84c9 100644 --- a/plugins/calendar/calendar.php +++ b/plugins/calendar/calendar.php @@ -1185,8 +1185,8 @@ class calendar extends rcube_plugin $_savemode = $event['_savemode']; // send notification for the main event when savemode is 'all' - if ($action != 'remove' && $_savemode == 'all' && $old['recurrence_id']) { - $event['id'] = $old['recurrence_id']; + if ($action != 'remove' && $_savemode == 'all' && ($event['recurrence_id'] || $old['recurrence_id'] || ($old && $old['id'] != $event['id']))) { + $event['id'] = $event['recurrence_id'] ?: ($old['recurrence_id'] ?: $old['id']); $event = $this->driver->get_event($event); unset($event['_instance'], $event['recurrence_date']); } diff --git a/plugins/libkolab/lib/kolab_format_xcal.php b/plugins/libkolab/lib/kolab_format_xcal.php index 4d3a7583..3a9ad1f6 100644 --- a/plugins/libkolab/lib/kolab_format_xcal.php +++ b/plugins/libkolab/lib/kolab_format_xcal.php @@ -662,10 +662,17 @@ abstract class kolab_format_xcal extends kolab_format $b = $b->format('Y-m-d'); } if ($prop == 'recurrence' && is_array($a) && is_array($b)) { - unset($a['EXCEPTIONS']); - unset($b['EXCEPTIONS']); + unset($a['EXCEPTIONS'], $b['EXCEPTIONS']); $a = array_filter($a); $b = array_filter($b); + + // advanced rrule comparison: no rescheduling if series was shortened + if ($a['COUNT'] && $b['COUNT'] && $b['COUNT'] < $a['COUNT']) { + unset($a['COUNT'], $b['COUNT']); + } + else if ($a['UNTIL'] && $b['UNTIL'] && $b['UNTIL'] < $a['UNTIL']) { + unset($a['UNTIL'], $b['UNTIL']); + } } if ($a != $b) { $reschedule = true;