summaryrefslogtreecommitdiff
path: root/program/lib/Roundcube/rcube_imap.php
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2013-06-11 09:28:33 +0200
committerAleksander Machniak <alec@alec.pl>2013-06-11 09:28:33 +0200
commit545559307e2cf7d986af5993f7d3ea0fc30a8386 (patch)
tree49857026f20b02a81daaf28ce7f6f056d99f6781 /program/lib/Roundcube/rcube_imap.php
parent49224720be7041b0865dd5d776da3513fd69035a (diff)
Make sure to use threads result cached in-memory for correct folder
Diffstat (limited to 'program/lib/Roundcube/rcube_imap.php')
-rw-r--r--program/lib/Roundcube/rcube_imap.php22
1 files changed, 12 insertions, 10 deletions
diff --git a/program/lib/Roundcube/rcube_imap.php b/program/lib/Roundcube/rcube_imap.php
index 257efbbbc..39057a89a 100644
--- a/program/lib/Roundcube/rcube_imap.php
+++ b/program/lib/Roundcube/rcube_imap.php
@@ -812,20 +812,22 @@ class rcube_imap extends rcube_storage
return $mcache->get_thread($folder);
}
- if (empty($this->icache['threads'])) {
- if (!$this->check_connection()) {
- return new rcube_result_thread();
+ if (!empty($this->icache['threads'])) {
+ if ($this->icache['threads']->get_parameters('MAILBOX') == $folder) {
+ return $this->icache['threads'];
}
+ }
- // get all threads
- $result = $this->conn->thread($folder, $this->threading,
- $this->options['skip_deleted'] ? 'UNDELETED' : '', true);
-
- // add to internal (fast) cache
- $this->icache['threads'] = $result;
+ if (!$this->check_connection()) {
+ return new rcube_result_thread();
}
- return $this->icache['threads'];
+ // get all threads
+ $result = $this->conn->thread($folder, $this->threading,
+ $this->options['skip_deleted'] ? 'UNDELETED' : '', true);
+
+ // add to internal (fast) cache
+ return $this->icache['threads'] = $result;
}