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

trac at roundcube.net trac at roundcube.net
Tue Mar 23 10:40:47 CET 2010


Author: alec
Date: 2010-03-23 04:40:47 -0500 (Tue, 23 Mar 2010)
New Revision: 3401

Modified:
   trunk/roundcubemail/program/include/rcube_imap.php
Log:
- Set maxuid in threads mode, to prevent unnecessary list reloading on (first) check_recent


Modified: trunk/roundcubemail/program/include/rcube_imap.php
===================================================================
--- trunk/roundcubemail/program/include/rcube_imap.php	2010-03-23 08:30:20 UTC (rev 3400)
+++ trunk/roundcubemail/program/include/rcube_imap.php	2010-03-23 09:40:47 UTC (rev 3401)
@@ -532,16 +532,16 @@
     if (!is_array($a_mailbox_cache[$mailbox]))
       $a_mailbox_cache[$mailbox] = array();
 
-    if ($mode == 'THREADS')
-      $count = $this->_threadcount($mailbox);
-
+    if ($mode == 'THREADS') {
+      $count = $this->_threadcount($mailbox, $msg_count);
+      $_SESSION['maxuid'][$mailbox] = $msg_count ? $this->_id2uid($msg_count) : 0;
+      }
     // RECENT count is fetched a bit different
-    else if ($mode == 'RECENT')
+    else if ($mode == 'RECENT') {
        $count = iil_C_CheckForRecent($this->conn, $mailbox);
-
+      }
     // use SEARCH for message counting
-    else if ($this->skip_deleted)
-      {
+    else if ($this->skip_deleted) {
       $search_str = "ALL UNDELETED";
 
       // get message count and store in cache
@@ -585,12 +585,14 @@
    * @access  private
    * @see     rcube_imap::messagecount()
    */
-  private function _threadcount($mailbox)
+  private function _threadcount($mailbox, &$msg_count)
     {
     if (!empty($this->icache['threads']))
       return count($this->icache['threads']['tree']);
     
     list ($thread_tree, $msg_depth, $has_children) = $this->_fetch_threads($mailbox);
+    
+    $msg_count = count($msg_depth);
 
 //    $this->update_thread_cache($mailbox, $thread_tree, $msg_depth, $has_children);
     return count($thread_tree);  

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



More information about the Svn mailing list