Fixed working with disabled kolab_cache

This commit is contained in:
Aleksander Machniak 2012-05-15 13:57:27 +02:00
parent d9924e675d
commit d08cb11137

View file

@ -82,7 +82,8 @@ class kolab_storage_cache
return; return;
// lock synchronization for this folder or wait if locked // lock synchronization for this folder or wait if locked
$this->_sync_lock(); if (!$this->_sync_lock())
return;
// synchronize IMAP mailbox cache // synchronize IMAP mailbox cache
$this->imap->folder_sync($this->folder->name); $this->imap->folder_sync($this->folder->name);
@ -303,7 +304,7 @@ class kolab_storage_cache
$filter = $this->_query2assoc($query); $filter = $this->_query2assoc($query);
// use 'list' for folder's default objects // use 'list' for folder's default objects
if ($filter['type'] == $this->type) { if ($filter['type'] == $this->type && !empty($this->index)) {
$index = $this->index; $index = $this->index;
} }
else { // search by object type else { // search by object type
@ -483,7 +484,7 @@ class kolab_storage_cache
private function _sync_lock() private function _sync_lock()
{ {
if (!$this->ready) if (!$this->ready)
return; return false;
$sql_arr = $this->db->fetch_assoc($this->db->query( $sql_arr = $this->db->fetch_assoc($this->db->query(
"SELECT msguid AS locked FROM kolab_cache ". "SELECT msguid AS locked FROM kolab_cache ".
@ -517,6 +518,8 @@ class kolab_storage_cache
'lock' 'lock'
); );
} }
return true;
} }
/** /**