summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Bruederli <bruederli@kolabsys.com>2013-06-19 12:34:17 (GMT)
committerThomas Bruederli <bruederli@kolabsys.com>2013-06-19 12:34:17 (GMT)
commite325881f6e5be23fc106c6b552b1d86fb263fa72 (patch)
tree414c362611f3b26f92c78e8398f9737f80f06406
parent4cbd7c0e19c18897717b13eed9644cccbe6c2096 (diff)
downloadiRony-e325881f6e5be23fc106c6b552b1d86fb263fa72.tar.gz
Adjust folder UID handling according to the proposed KEP
-rw-r--r--lib/Kolab/Utils/DAVBackend.php10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/Kolab/Utils/DAVBackend.php b/lib/Kolab/Utils/DAVBackend.php
index d772eb8..97985a2 100644
--- a/lib/Kolab/Utils/DAVBackend.php
+++ b/lib/Kolab/Utils/DAVBackend.php
@@ -31,8 +31,8 @@ use \rcube_utils;
*/
class DAVBackend
{
- const IMAP_UID_KEY = '/shared/vendor/kolab/dav-uid';
- const IMAP_UID_KEY_PRIVATE = '/private/vendor/kolab/dav-uid';
+ const IMAP_UID_KEY = '/shared/vendor/kolab/uniqueid';
+ const IMAP_UID_KEY_PRIVATE = '/private/vendor/kolab/uniqueid';
const IMAP_UID_KEY_CYRUS = '/shared/vendor/cmu/cyrus-imapd/uniqueid';
/**
@@ -60,8 +60,8 @@ class DAVBackend
*/
public static function get_uid($folder)
{
- // color is defined in folder METADATA
- $metakeys = array(self::IMAP_UID_KEY_CYRUS, self::IMAP_UID_KEY, self::IMAP_UID_KEY_PRIVATE);
+ // UID is defined in folder METADATA
+ $metakeys = array(self::IMAP_UID_KEY, self::IMAP_UID_KEY_PRIVATE, self::IMAP_UID_KEY_CYRUS);
$metadata = $folder->get_metadata($metakeys);
foreach ($metakeys as $key) {
if (($uid = $metadata[$key])) {
@@ -70,7 +70,7 @@ class DAVBackend
}
// generate a folder UID and set it to IMAP
- $uid = rtrim(chunk_split(md5($folder->name), 12, '-'), '-');
+ $uid = rtrim(chunk_split(md5($folder->name . $folder->get_owner()), 12, '-'), '-');
self::set_uid($folder, $uid);
return $uid;