summaryrefslogtreecommitdiff
path: root/roundcubemail/program/include
diff options
context:
space:
mode:
Diffstat (limited to 'roundcubemail/program/include')
-rw-r--r--roundcubemail/program/include/rcube_imap.php4
1 files changed, 3 insertions, 1 deletions
diff --git a/roundcubemail/program/include/rcube_imap.php b/roundcubemail/program/include/rcube_imap.php
index a05dcf1aa..e5abe8a5f 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, 'ALL');
+ $max = $this->_messagecount($mailbox, rcmail::get_instance()->config->get('imap_thread_algorithm'), 'ALL');
list($begin, $end) = $this->_get_message_range($max, $page);
@@ -696,6 +696,8 @@ 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);
}