summaryrefslogtreecommitdiff
path: root/plugins/kolab_notes
diff options
context:
space:
mode:
authorThomas Bruederli <bruederli@kolabsys.com>2015-01-13 21:19:52 (GMT)
committerThomas Bruederli <bruederli@kolabsys.com>2015-01-13 21:19:52 (GMT)
commit0a51ccd5a44882e84c0f14cf41e5c0bc790fb469 (patch)
tree1306248a286becc2b0f674da3ab88420607253f5 /plugins/kolab_notes
parent0dc0490ba02ebc695f7efd027f2b2af6f55ef1e1 (diff)
downloadroundcubemail-plugins-kolab-0a51ccd5a44882e84c0f14cf41e5c0bc790fb469.tar.gz
Consolidate message reference handling functions into libkolab plugin (in preparation for #4161)
Diffstat (limited to 'plugins/kolab_notes')
-rw-r--r--plugins/kolab_notes/kolab_notes.php32
1 files changed, 6 insertions, 26 deletions
diff --git a/plugins/kolab_notes/kolab_notes.php b/plugins/kolab_notes/kolab_notes.php
index c2b4945..b472d2a 100644
--- a/plugins/kolab_notes/kolab_notes.php
+++ b/plugins/kolab_notes/kolab_notes.php
@@ -394,7 +394,10 @@ class kolab_notes extends rcube_plugin
$this->rc->output->set_env('kolab_notes_template', array(
'_from_mail' => true,
'title' => $message->get('subject'),
- 'links' => array($this->get_message_reference(kolab_storage_config::get_message_uri($message, $folder))),
+ 'links' => array(kolab_storage_config::get_message_reference(
+ kolab_storage_config::get_message_uri($message, $folder),
+ 'note'
+ )),
));
}
}
@@ -573,9 +576,8 @@ class kolab_notes extends rcube_plugin
}
// resolve message links
- $me = $this;
- $note['links'] = array_map(function($link) use ($me, $resolve) {
- return $me->get_message_reference($link, $resolve) ?: array('uri' => $link);
+ $note['links'] = array_map(function($link) {
+ return kolab_storage_config::get_message_reference($link, 'note') ?: array('uri' => $link);
}, $this->get_links($note['uid']));
return $note;
@@ -1043,28 +1045,6 @@ class kolab_notes extends rcube_plugin
}
/**
- * Resolve the email message reference from the given URI
- */
- public function get_message_reference($uri, $resolve = false)
- {
- if ($linkref = kolab_storage_config::parse_member_url($uri)) {
- $linkref['subject'] = $linkref['params']['subject'];
- $linkref['uri'] = $uri;
- $linkref['mailurl'] = $this->rc->url(array(
- 'task' => 'mail',
- 'action' => 'show',
- 'mbox' => $linkref['folder'],
- 'uid' => $linkref['uid'],
- 'rel' => 'note',
- ));
-
- unset($linkref['params']);
- }
-
- return $linkref;
- }
-
- /**
* Update note tags
*/
private function save_tags($uid, $tags)