[Svn] r3709 - trunk/roundcubemail/program/include

trac at roundcube.net trac at roundcube.net
Fri Jun 4 09:05:07 CEST 2010


Author: alec
Date: 2010-06-04 02:05:06 -0500 (Fri, 04 Jun 2010)
New Revision: 3709

Modified:
   trunk/roundcubemail/program/include/rcube_imap.php
Log:
- Fix: don't call FETCH when THREADS returns empty result


Modified: trunk/roundcubemail/program/include/rcube_imap.php
===================================================================
--- trunk/roundcubemail/program/include/rcube_imap.php	2010-06-04 06:24:31 UTC (rev 3708)
+++ trunk/roundcubemail/program/include/rcube_imap.php	2010-06-04 07:05:06 UTC (rev 3709)
@@ -822,8 +822,11 @@
             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,9 +948,16 @@
     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'];
         $has_children = $this->search_set['children'];

_______________________________________________
http://lists.roundcube.net/mailman/listinfo/svn



More information about the Svn mailing list