Branch 'dev/kolab3' - plugins/libkolab
Aleksander Machniak
machniak at kolabsys.com
Tue May 15 13:57:47 CEST 2012
plugins/libkolab/lib/kolab_storage_cache.php | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
New commits:
commit d08cb11137116a7f3a98adb48750b6edccf68abe
Author: Aleksander Machniak <alec at alec.pl>
Date: Tue May 15 13:57:27 2012 +0200
Fixed working with disabled kolab_cache
diff --git a/plugins/libkolab/lib/kolab_storage_cache.php b/plugins/libkolab/lib/kolab_storage_cache.php
index 9f9431c..19a4815 100644
--- a/plugins/libkolab/lib/kolab_storage_cache.php
+++ b/plugins/libkolab/lib/kolab_storage_cache.php
@@ -82,7 +82,8 @@ class kolab_storage_cache
return;
// lock synchronization for this folder or wait if locked
- $this->_sync_lock();
+ if (!$this->_sync_lock())
+ return;
// synchronize IMAP mailbox cache
$this->imap->folder_sync($this->folder->name);
@@ -186,7 +187,7 @@ class kolab_storage_cache
kolab_storage::get_folder($foldername)->cache->set($msguid, $object);
return;
}
-
+
// write to cache
if ($this->ready) {
// remove old entry
@@ -303,7 +304,7 @@ class kolab_storage_cache
$filter = $this->_query2assoc($query);
// use 'list' for folder's default objects
- if ($filter['type'] == $this->type) {
+ if ($filter['type'] == $this->type && !empty($this->index)) {
$index = $this->index;
}
else { // search by object type
@@ -483,7 +484,7 @@ class kolab_storage_cache
private function _sync_lock()
{
if (!$this->ready)
- return;
+ return false;
$sql_arr = $this->db->fetch_assoc($this->db->query(
"SELECT msguid AS locked FROM kolab_cache ".
@@ -517,6 +518,8 @@ class kolab_storage_cache
'lock'
);
}
+
+ return true;
}
/**
More information about the commits
mailing list