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

trac at roundcube.net trac at roundcube.net
Mon Oct 18 20:01:10 CEST 2010


Author: alec
Date: 2010-10-18 13:01:10 -0500 (Mon, 18 Oct 2010)
New Revision: 4104

Modified:
   trunk/roundcubemail/program/include/rcube_imap.php
Log:
- Fix regression in rcube_imap::_threadcount() which was the reason
  why mailbox_status() returned always "1" for folders with enabled threading


Modified: trunk/roundcubemail/program/include/rcube_imap.php
===================================================================
--- trunk/roundcubemail/program/include/rcube_imap.php	2010-10-18 17:32:34 UTC (rev 4103)
+++ trunk/roundcubemail/program/include/rcube_imap.php	2010-10-18 18:01:10 UTC (rev 4104)
@@ -585,18 +585,22 @@
      */
     private function _threadcount($mailbox, &$msg_count)
     {
-        if (!empty($this->icache['threads']))
+        if (!empty($this->icache['threads'])) {
+            $msg_count = count($this->icache['threads']['depth']);
             return count($this->icache['threads']['tree']);
+        }
 
-        if (is_array($result = $this->_fetch_threads($mailbox)))
+        if (is_array($result = $this->_fetch_threads($mailbox))) {
             $thread_tree = array_shift($result);
+            $msg_count = count($result[0]);
+        }
 
 //        list ($thread_tree, $msg_depth, $has_children) = $result;
 //        $this->update_thread_cache($mailbox, $thread_tree, $msg_depth, $has_children);
         return count($thread_tree);
     }
 
-    
+
     /**
      * Public method for listing headers
      * convert mailbox name with root dir first
@@ -615,7 +619,7 @@
         return $this->_list_headers($mailbox, $page, $sort_field, $sort_order, false, $slice);
     }
 
-    
+
     /**
      * Private method for listing message headers
      *
@@ -745,7 +749,7 @@
         return array_values($a_msg_headers);
     }
 
-    
+
     /**
      * Private method for listing message headers using threads
      *
@@ -1150,7 +1154,7 @@
 
                 $for_create[] = $headers->uid;
             }
-            
+
             if ($for_remove)
                 $this->remove_message_cache($cache_key, $for_remove);
 

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



More information about the Svn mailing list