summaryrefslogtreecommitdiff
path: root/plugins/kolab_folders
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2012-06-26 09:01:22 (GMT)
committerAleksander Machniak <alec@alec.pl>2012-06-26 09:01:22 (GMT)
commit4c6117ab672f32daf8f457e8add65c3660cf85b1 (patch)
tree2b2e57203690b0a33de870bf0fe334b83c642070 /plugins/kolab_folders
parentf05068fb3b8c531217bd7de716c7bac7bea42df8 (diff)
downloadroundcubemail-plugins-kolab-4c6117ab672f32daf8f457e8add65c3660cf85b1.tar.gz
Improve performance when imap_cache is disabled
Diffstat (limited to 'plugins/kolab_folders')
-rw-r--r--plugins/kolab_folders/kolab_folders.php19
1 files changed, 11 insertions, 8 deletions
diff --git a/plugins/kolab_folders/kolab_folders.php b/plugins/kolab_folders/kolab_folders.php
index 3e01061..9e00847 100644
--- a/plugins/kolab_folders/kolab_folders.php
+++ b/plugins/kolab_folders/kolab_folders.php
@@ -70,7 +70,7 @@ class kolab_folders extends rcube_plugin
$this->is_processing = true;
// get folders
- $folders = kolab_storage::list_folders($args['root'], $args['name'], $args['filter'], $args['mode'] == 'LSUB');
+ $folders = kolab_storage::list_folders($args['root'], $args['name'], $args['filter'], $args['mode'] == 'LSUB', $folderdata);
$this->is_processing = false;
@@ -80,7 +80,7 @@ class kolab_folders extends rcube_plugin
// Create default folders
if ($args['root'] == '' && $args['name'] = '*') {
- $this->create_default_folders($folders, $args['filter']);
+ $this->create_default_folders($folders, $args['filter'], $folderdata);
}
$args['folders'] = $folders;
@@ -420,20 +420,23 @@ class kolab_folders extends rcube_plugin
/**
* Creates default folders if they doesn't exist
*/
- private function create_default_folders(&$folders, $filter)
+ private function create_default_folders(&$folders, $filter, $folderdata = null)
{
$storage = $this->rc->get_storage();
$namespace = $storage->get_namespace();
- $folderdata = $storage->get_metadata('*', kolab_storage::CTYPE_KEY);
$defaults = array();
$need_update = false;
if (!is_array($folderdata)) {
- return;
- }
+ $folderdata = $storage->get_metadata('*', kolab_storage::CTYPE_KEY);
- // "Flattenize" metadata array to become a name->type hash
- $folderdata = array_map('implode', $folderdata);
+ if (!is_array($folderdata)) {
+ return;
+ }
+
+ // "Flattenize" metadata array to become a name->type hash
+ $folderdata = array_map('implode', $folderdata);
+ }
// Find personal namespace prefix
if (is_array($namespace['personal']) && count($namespace['personal']) == 1) {