summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Bruederli <bruederli@kolabsys.com>2014-09-08 17:25:00 (GMT)
committerThomas Bruederli <bruederli@kolabsys.com>2014-09-08 17:25:00 (GMT)
commitc835c93515043edbaeb35926c0e8a4f1a92688b8 (patch)
tree46363075e69930e864ff6d648950fe5535320447
parentb7d44255a94f236420f3e167e51094156b18054a (diff)
downloadiRony-c835c93515043edbaeb35926c0e8a4f1a92688b8.tar.gz
Use real list of tag/categories values for etag computation
-rw-r--r--lib/Kolab/CalDAV/CalendarBackend.php9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/Kolab/CalDAV/CalendarBackend.php b/lib/Kolab/CalDAV/CalendarBackend.php
index 3f81be4..ab1a1cd 100644
--- a/lib/Kolab/CalDAV/CalendarBackend.php
+++ b/lib/Kolab/CalDAV/CalendarBackend.php
@@ -296,6 +296,9 @@ class CalendarBackend extends CalDAV\Backend\AbstractBackend
continue;
}
+ // get tags/categories from relations
+ $this->load_tags($event);
+
$events[] = array(
'id' => $event['uid'],
'uri' => VObjectUtils::uid2uri($event['uid'], '.ics'),
@@ -436,6 +439,7 @@ class CalendarBackend extends CalDAV\Backend\AbstractBackend
// save tag relations on success (only available for tasks yet)
if ($object['_type'] == 'task') {
$this->save_tags($uid, $tags);
+ $object['categories'] = $tags; // add again for etag computation
}
// send Location: header if URI doesn't match object's UID (Bug #2109)
@@ -526,6 +530,7 @@ class CalendarBackend extends CalDAV\Backend\AbstractBackend
// save tag relations on success (only available for tasks yet)
if ($object['_type'] == 'task') {
$this->save_tags($uid, $tags);
+ $object['categories'] = $tags; // add again for etag computation
}
// return new Etag
@@ -809,10 +814,10 @@ class CalendarBackend extends CalDAV\Backend\AbstractBackend
*/
private static function _get_etag($event)
{
- return sprintf('"%s-%d-%d"',
+ return sprintf('"%s-%d-%s"',
substr(md5($event['uid']), 0, 16),
$event['_msguid'],
- is_object($event['changed']) ? $event['changed']->format('U') : 0
+ !empty($event['categories']) ? substr(md5(join(',', (array)$event['categories'])), 0, 16) : '0'
);
}