diff --git a/plugins/libkolab/config.inc.php.dist b/plugins/libkolab/config.inc.php.dist index a2c15e8c..a6338e74 100644 --- a/plugins/libkolab/config.inc.php.dist +++ b/plugins/libkolab/config.inc.php.dist @@ -35,7 +35,8 @@ $config['kolab_http_request'] = array(); // When kolab_cache is enabled Roundcube's messages cache will be redundant // when working on kolab folders. Here we can: -// 2 - bypass messages/indexes cache completely +// 3 - bypass only indexes, but use messages cache +// 2 - bypass both messages and indexes cache // 1 - bypass only messages, but use index cache $config['kolab_messages_cache_bypass'] = 0; diff --git a/plugins/libkolab/lib/kolab_storage_cache.php b/plugins/libkolab/lib/kolab_storage_cache.php index 0912ebf1..cc3f2cf0 100644 --- a/plugins/libkolab/lib/kolab_storage_cache.php +++ b/plugins/libkolab/lib/kolab_storage_cache.php @@ -1155,7 +1155,7 @@ class kolab_storage_cache } /** - * Set Roundcube storage options and bypass messages cache. + * Set Roundcube storage options and bypass messages/indexes cache. * * We use skip_deleted and threading settings specific to Kolab, * we have to change these global settings only temporarily. @@ -1210,17 +1210,18 @@ class kolab_storage_cache switch ($cache_bypass) { case 2: - // Disable messages cache completely + // Disable messages and index cache completely $this->imap->set_messages_caching(!$force); break; + case 3: case 1: - // We'll disable messages cache, but keep index cache. + // We'll disable messages cache, but keep index cache (1) or vice-versa (3) // Default mode is both (MODE_INDEX | MODE_MESSAGE) - $mode = rcube_imap_cache::MODE_INDEX; + $mode = $cache_bypass == 3 ? rcube_imap_cache::MODE_MESSAGE : rcube_imap_cache::MODE_INDEX; if (!$force) { - $mode |= rcube_imap_cache::MODE_MESSAGE; + $mode |= $cache_bypass == 3 ? rcube_imap_cache::MODE_INDEX : rcube_imap_cache::MODE_MESSAGE; } $this->imap->set_messages_caching(true, $mode);