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

trac at roundcube.net trac at roundcube.net
Sun May 10 10:59:39 CEST 2009


Author: alec
Date: 2009-05-10 03:59:39 -0500 (Sun, 10 May 2009)
New Revision: 2465

Modified:
   trunk/roundcubemail/program/include/rcube_imap.php
Log:
- speed up remove_message_cache() by using message uid instead of idx


Modified: trunk/roundcubemail/program/include/rcube_imap.php
===================================================================
--- trunk/roundcubemail/program/include/rcube_imap.php	2009-05-10 08:37:11 UTC (rev 2464)
+++ trunk/roundcubemail/program/include/rcube_imap.php	2009-05-10 08:59:39 UTC (rev 2465)
@@ -796,7 +796,7 @@
           {
           // delete from cache
           if ($cache_index[$headers->id] && $cache_index[$headers->id] == $headers->uid)
-            $this->remove_message_cache($cache_key, $headers->id);
+            $this->remove_message_cache($cache_key, $headers->uid);
 
           $deleted_count++;
           continue;
@@ -927,7 +927,7 @@
       // other message at this position
       if (isset($cache_index[$id]))
         {
-        $this->remove_message_cache($cache_key, $id);
+        $this->remove_message_cache($cache_key, $cache_index[$id]);
         unset($cache_index[$id]);
         }
         
@@ -941,7 +941,7 @@
     if (!empty($cache_index))
       {
       foreach ($cache_index as $id => $uid)
-        $this->remove_message_cache($cache_key, $id);
+        $this->remove_message_cache($cache_key, $uid);
       }
     }
 
@@ -1436,7 +1436,7 @@
     if ($print)
       {
       $mode = $o_part->encoding == 'base64' ? 3 : ($o_part->encoding == 'quoted-printable' ? 1 : 2);
-      $body = iil_C_HandlePartBody($this->conn, $this->mailbox, $msg_id, $part, $mode);
+      $body = iil_C_HandlePartBody($this->conn, $this->mailbox, '', $part, $mode);
       
       // we have to decode the part manually before printing
       if ($mode == 1)
@@ -1567,7 +1567,7 @@
       {
       foreach ($uids as $uid)
         if ($cached_headers = $this->get_cached_message($cache_key, $uid))
-          $this->remove_message_cache($cache_key, $this->_uid2id($uid));
+          $this->remove_message_cache($cache_key, $uid);
 
       // close and re-open connection
       // this prevents connection problems with Courier 
@@ -2430,7 +2430,7 @@
   /**
    * @access private
    */
-  function remove_message_cache($key, $index)
+  function remove_message_cache($key, $uid)
     {
     if (!$this->caching_enabled)
       return;
@@ -2439,10 +2439,10 @@
       "DELETE FROM ".get_table_name('messages')."
        WHERE  user_id=?
        AND    cache_key=?
-       AND    idx=?",
+       AND    uid=?",
       $_SESSION['user_id'],
       $key,
-      $index);
+      $uid);
     }
 
   /**

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



More information about the Svn mailing list