summaryrefslogtreecommitdiff
path: root/plugins/libkolab
diff options
context:
space:
mode:
authorAleksander Machniak <machniak@kolabsys.com>2015-01-16 13:06:40 (GMT)
committerAleksander Machniak <machniak@kolabsys.com>2015-01-16 13:06:40 (GMT)
commit8e0946f482a2cb03dbb65754abe8a5020e393551 (patch)
tree0b1382c795eb51393c974d9ce44eca600ad19659 /plugins/libkolab
parentbd9b14e3c6934eda23809c345e7a2061fb42207c (diff)
parentb02e2c3b8f9ef6a63eba80f84432b33a00da95d1 (diff)
downloadroundcubemail-plugins-kolab-8e0946f482a2cb03dbb65754abe8a5020e393551.tar.gz
Merge branch 'master' of ssh://git.kolabsys.com/git/roundcube
Diffstat (limited to 'plugins/libkolab')
-rw-r--r--plugins/libkolab/lib/kolab_storage_config.php44
1 files changed, 26 insertions, 18 deletions
diff --git a/plugins/libkolab/lib/kolab_storage_config.php b/plugins/libkolab/lib/kolab_storage_config.php
index 59c191d..036b827 100644
--- a/plugins/libkolab/lib/kolab_storage_config.php
+++ b/plugins/libkolab/lib/kolab_storage_config.php
@@ -356,24 +356,6 @@ 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
@@ -855,4 +837,30 @@ class kolab_storage_config
return self::build_member_url($params);
}
+
+ /**
+ * Resolve the email message reference from the given URI
+ */
+ public function get_message_reference($uri, $rel = null)
+ {
+ if ($linkref = self::parse_member_url($uri)) {
+ $linkref['subject'] = $linkref['params']['subject'];
+ $linkref['uri'] = $uri;
+
+ $rcmail = rcube::get_instance();
+ if (method_exists($rcmail, 'url')) {
+ $linkref['mailurl'] = $rcmail->url(array(
+ 'task' => 'mail',
+ 'action' => 'show',
+ 'mbox' => $linkref['folder'],
+ 'uid' => $linkref['uid'],
+ 'rel' => $rel,
+ ));
+ }
+
+ unset($linkref['params']);
+ }
+
+ return $linkref;
+ }
}