summaryrefslogtreecommitdiff
path: root/program
diff options
context:
space:
mode:
authoralecpl <alec@alec.pl>2010-06-04 07:05:06 +0000
committeralecpl <alec@alec.pl>2010-06-04 07:05:06 +0000
commitf22b5439f2e783f47f61042bebb6cc53672568fd (patch)
tree00465fa3e38585f5599ee4ab6519eaf3e3889e12 /program
parentf6b28244a1307a493e0e4dbd8aa3429df53446e5 (diff)
- Fix: don't call FETCH when THREADS returns empty result
Diffstat (limited to 'program')
-rw-r--r--program/include/rcube_imap.php14
1 files changed, 12 insertions, 2 deletions
diff --git a/program/include/rcube_imap.php b/program/include/rcube_imap.php
index 97662e4ba..926a864b8 100644
--- a/program/include/rcube_imap.php
+++ b/program/include/rcube_imap.php
@@ -822,8 +822,11 @@ class rcube_imap
return $this->_list_thread_header_set($mailbox, $page, $sort_field, $sort_order, $slice);
// search set is threaded, we need a new one
- if ($this->search_threads)
+ if ($this->search_threads) {
+ if (empty($this->search_set['tree']))
+ return array();
$this->search('', $this->search_string, $this->search_charset, $sort_field);
+ }
$msgs = $this->search_set;
$a_msg_headers = array();
@@ -945,8 +948,15 @@ class rcube_imap
private function _list_thread_header_set($mailbox, $page=NULL, $sort_field=NULL, $sort_order=NULL, $slice=0)
{
// update search_set if previous data was fetched with disabled threading
- if (!$this->search_threads)
+ if (!$this->search_threads) {
+ if (empty($this->search_set))
+ return array();
$this->search('', $this->search_string, $this->search_charset, $sort_field);
+ }
+
+ // empty result
+ if (empty($this->search_set['tree']))
+ return array();
$thread_tree = $this->search_set['tree'];
$msg_depth = $this->search_set['depth'];