Compare sequence number from iTip replies

This commit is contained in:
Thomas Bruederli 2014-07-08 18:30:12 +02:00
parent 3db5611180
commit 634cb85fb5
2 changed files with 4 additions and 4 deletions

View file

@ -258,8 +258,8 @@ class libcalendaring_itip
// check if the given itip object matches the last state // check if the given itip object matches the last state
if ($existing) { if ($existing) {
$latest = ($event['sequence'] && $existing['sequence'] == $event['sequence']) || $latest = (isset($event['sequence']) && $existing['sequence'] == $event['sequence']) ||
(!$event['sequence'] && $existing['changed'] && $existing['changed'] >= $event['changed']); (!isset($event['sequence']) && $existing['changed'] && $existing['changed'] >= $event['changed']);
} }
// determine action for REQUEST // determine action for REQUEST
@ -320,7 +320,7 @@ class libcalendaring_itip
) )
))); )));
} }
$action = $attendee['status'] == $status ? '' : 'update'; $action = $attendee['status'] == $status || !$latest ? '' : 'update';
$listed = true; $listed = true;
break; break;
} }

View file

@ -919,7 +919,7 @@ class libvcalendar implements Iterator
if ($event['description']) if ($event['description'])
$ve->add('DESCRIPTION', strtr($event['description'], array("\r\n" => "\n", "\r" => "\n"))); // normalize line endings $ve->add('DESCRIPTION', strtr($event['description'], array("\r\n" => "\n", "\r" => "\n"))); // normalize line endings
if ($event['sequence']) if (isset($event['sequence']))
$ve->add('SEQUENCE', $event['sequence']); $ve->add('SEQUENCE', $event['sequence']);
if ($event['recurrence'] && !$recurrence_id) { if ($event['recurrence'] && !$recurrence_id) {