summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Bruederli <bruederli@kolabsys.com>2014-09-25 08:08:23 (GMT)
committerThomas Bruederli <bruederli@kolabsys.com>2014-09-25 08:08:23 (GMT)
commit476108442902a017be8727658eaecb5a69b1a31d (patch)
treecd7c739754ec51df74ac79b3d7fb9414f86c4946
parentd31fd0e0a7b2464e8d2aaa19c13dd1694b4e2264 (diff)
downloadiRony-476108442902a017be8727658eaecb5a69b1a31d.tar.gz
Use IMAP folder name for UID if writing to imap metadata fails
-rw-r--r--lib/Kolab/Utils/DAVBackend.php7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/Kolab/Utils/DAVBackend.php b/lib/Kolab/Utils/DAVBackend.php
index 4de51ad..9cc434b 100644
--- a/lib/Kolab/Utils/DAVBackend.php
+++ b/lib/Kolab/Utils/DAVBackend.php
@@ -73,9 +73,12 @@ class DAVBackend
// generate a folder UID and set it to IMAP
$uid = rtrim(chunk_split(md5($folder->name . $folder->get_owner() . uniqid('-', true)), 12, '-'), '-');
- self::set_uid($folder, $uid);
+ if (self::set_uid($folder, $uid)) {
+ return $uid;
+ }
- return $uid;
+ // use folder name if we can't write the UID metadata
+ return md5($folder->name . $folder->get_owner());
}
/**