Fix rcube_imap_cache in mode set to MESSAGE only

pull/6566/head
Aleksander Machniak 6 years ago
parent 328c32402d
commit b0c83111de

@ -612,6 +612,10 @@ class rcube_imap_cache
*/
function remove_index($mailbox = null, $remove = false)
{
if (!($this->mode & self::MODE_INDEX)) {
return;
}
// The index should be only removed from database when
// UIDVALIDITY was detected or the mailbox is empty
// otherwise use 'valid' flag to not loose HIGHESTMODSEQ value
@ -646,10 +650,14 @@ class rcube_imap_cache
/**
* Clears thread cache.
*
* @param string $mailbox Folder name
* @param string $mailbox Folder name
*/
function remove_thread($mailbox = null)
{
if (!($this->mode & self::MODE_INDEX)) {
return;
}
$this->db->query(
"DELETE FROM {$this->thread_table}"
." WHERE `user_id` = ?"
@ -704,6 +712,10 @@ class rcube_imap_cache
*/
private function get_index_row($mailbox)
{
if (!($this->mode & self::MODE_INDEX)) {
return;
}
// Get index from DB
$sql_result = $this->db->query(
"SELECT `data`, `valid`"
@ -731,8 +743,6 @@ class rcube_imap_cache
'modseq' => $data[5],
);
}
return null;
}
/**
@ -740,6 +750,10 @@ class rcube_imap_cache
*/
private function get_thread_row($mailbox)
{
if (!($this->mode & self::MODE_INDEX)) {
return;
}
// Get thread from DB
$sql_result = $this->db->query(
"SELECT `data`"
@ -764,8 +778,6 @@ class rcube_imap_cache
'uidnext' => $data[3],
);
}
return null;
}
/**
@ -774,6 +786,10 @@ class rcube_imap_cache
private function add_index_row($mailbox, $sort_field,
$data, $mbox_data = array(), $exists = false, $modseq = null)
{
if (!($this->mode & self::MODE_INDEX)) {
return;
}
$data = array(
$this->db->encode($data, true),
$sort_field,
@ -826,6 +842,10 @@ class rcube_imap_cache
*/
private function add_thread_row($mailbox, $data, $mbox_data = array(), $exists = false)
{
if (!($this->mode & self::MODE_INDEX)) {
return;
}
$data = array(
$this->db->encode($data, true),
(int) $this->skip_deleted,

Loading…
Cancel
Save