summaryrefslogtreecommitdiff
path: root/roundcubemail/program/include
diff options
context:
space:
mode:
authorNathan Kinkade <nkinkade@nkinka.de>2009-03-21 23:28:46 +0000
committerNathan Kinkade <nkinkade@nkinka.de>2009-03-21 23:28:46 +0000
commitccbbc410c6ea7294162616dc0d1005c022ceaced (patch)
tree74415d776604d552a3e05098e4b1c703b70ae276 /roundcubemail/program/include
parent71a7f2a74f77d3afe0c0c3465a22f87d4827dd5a (diff)
So it seems that commits efdff41, cbc33bd, and 8f612c3 were all for naught and the problem may in fact be a bug with Dovecot. I have asked on the Dovecot mailist. Meantime, this is a workaround.
Diffstat (limited to 'roundcubemail/program/include')
-rw-r--r--roundcubemail/program/include/rcube_imap.php10
1 files changed, 7 insertions, 3 deletions
diff --git a/roundcubemail/program/include/rcube_imap.php b/roundcubemail/program/include/rcube_imap.php
index e5abe8a5f..c89a4ff4a 100644
--- a/roundcubemail/program/include/rcube_imap.php
+++ b/roundcubemail/program/include/rcube_imap.php
@@ -587,7 +587,7 @@ class rcube_imap
$message_threading = $this->get_capability('thread=references') &&
rcmail::get_instance()->imap->threading;
- $max = $this->_messagecount($mailbox, rcmail::get_instance()->config->get('imap_thread_algorithm'), 'ALL');
+ $max = $this->_messagecount($mailbox, ($message_threading) ? 'THREADS' : 'ALL');
list($begin, $end) = $this->_get_message_range($max, $page);
@@ -622,6 +622,12 @@ class rcube_imap
} else {
list ($thread_tree, $msg_depth, $has_children) = iil_C_Thread($this->conn, $mailbox, rcmail::get_instance()->config->get('imap_thread_algorithm'), 'ALL');
}
+
+ // Temporary fix for a possible bug in Dovecot X-REFERENCES2.
+ // Remove this if/when the bug is fixed or the problem solved.
+ if ($thread_tree && array_key_exists(0,$thread_tree))
+ unset($thread_tree[0]);
+
$this->update_thread_cache($mailbox, $thread_tree, $msg_depth, $has_children);
// the keys of thread_tree are the thread roots
$roots = array_keys($thread_tree);
@@ -696,8 +702,6 @@ class rcube_imap
$deleted_count = $this->_fetch_headers($mailbox, $msgs, $a_msg_headers, $cache_key);
// delete cached messages with a higher index than $max+1
// Changed $max to $max+1 to fix this bug : #1484295
- if ($message_threading)
- $max = $this->_messagecount($mailbox, 'ALL');
$this->clear_message_cache($cache_key, $max + 1);
}