summaryrefslogtreecommitdiff
path: root/lib/Kolab/Utils
diff options
context:
space:
mode:
authorThomas Bruederli <bruederli@kolabsys.com>2013-11-21 11:31:32 (GMT)
committerThomas Bruederli <bruederli@kolabsys.com>2013-11-21 11:33:15 (GMT)
commit51e77fd51ff25cdfd0bd965ec24ced5bb4a383b0 (patch)
tree8a57143adf9047ac52776f5f5a1da40fb08798dd /lib/Kolab/Utils
parent3fa751f485efbd5c98310ce1bac723712ff3dd7c (diff)
downloadiRony-51e77fd51ff25cdfd0bd965ec24ced5bb4a383b0.tar.gz
Avoid unnecessary metadata updates sent by Apple Clients
Diffstat (limited to 'lib/Kolab/Utils')
-rw-r--r--lib/Kolab/Utils/DAVBackend.php11
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/Kolab/Utils/DAVBackend.php b/lib/Kolab/Utils/DAVBackend.php
index 1111216..0989032 100644
--- a/lib/Kolab/Utils/DAVBackend.php
+++ b/lib/Kolab/Utils/DAVBackend.php
@@ -143,9 +143,13 @@ class DAVBackend
foreach ($mutations as $prop => $val) {
switch ($prop) {
case '{DAV:}displayname':
+ // abort if name didn't change
+ if ($val == html_entity_decode($folder->get_name(), ENT_COMPAT, RCUBE_CHARSET)) {
+ break;
+ }
// restrict renaming to personal folders only
if ($folder->get_namespace() == 'personal') {
- $parts = preg_split('!(\s*/\s*|\s+[:]\s+)!', $val);
+ $parts = preg_split('!(\s*/\s*|\s+[»:]\s+)!', $val);
$updates['oldname'] = $folder->name;
$updates['name'] = array_pop($parts);
$updates['parent'] = join('/', $parts);
@@ -156,7 +160,10 @@ class DAVBackend
break;
case '{http://apple.com/ns/ical/}calendar-color':
- $updates['color'] = substr(trim($val, '#'), 0, 6);
+ $newcolor = substr(trim($val, '#'), 0, 6);
+ if (strcasecmp($newcolor, $folder->get_color())) {
+ $updates['color'] = $newcolor;
+ }
break;
case '{urn:ietf:params:xml:ns:caldav}calendar-description':