summaryrefslogtreecommitdiff
path: root/plugins/libkolab/lib/kolab_storage_config.php
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/libkolab/lib/kolab_storage_config.php')
-rw-r--r--plugins/libkolab/lib/kolab_storage_config.php18
1 files changed, 18 insertions, 0 deletions
diff --git a/plugins/libkolab/lib/kolab_storage_config.php b/plugins/libkolab/lib/kolab_storage_config.php
index d58e3c0..59c191d 100644
--- a/plugins/libkolab/lib/kolab_storage_config.php
+++ b/plugins/libkolab/lib/kolab_storage_config.php
@@ -356,6 +356,24 @@ class kolab_storage_config
}
/**
+ * Simplify the given message URI by converting the mailbox
+ * part into a relative IMAP path valid for the current user.
+ */
+ public static function local_message_uri($uri)
+ {
+ if (strpos($uri, 'imap:///') === 0) {
+ $linkref = kolab_storage_config::parse_member_url($uri);
+
+ return 'imap:///' . implode('/', array_map('rawurlencode', explode('/', $linkref['folder']))) .
+ '/' . $linkref['uid'] .
+ '?' . http_build_query($linkref['params'], '', '&');
+ }
+
+ return $uri;
+ }
+
+
+ /**
* Build array of member URIs from set of messages
*
* @param string $folder Folder name