alecpl
2009-05-10 78cdeba1a82dd744f59ebfe625a7d7dd8d23ff41
program/include/rcube_imap.php
@@ -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);
      }
    }
@@ -1566,14 +1566,8 @@
    if ($this->caching_enabled)
      {
      foreach ($uids as $uid)
        {
   $id = $this->_uid2id($uid);
        if ($cached_headers = $this->get_cached_message($cache_key, $id))
          {
          $this->remove_message_cache($cache_key, $id);
          //$this->get_headers($uid);
          }
        }
        if ($cached_headers = $this->get_cached_message($cache_key, $uid))
          $this->remove_message_cache($cache_key, $uid);
      // close and re-open connection
      // this prevents connection problems with Courier 
@@ -2436,7 +2430,7 @@
  /**
   * @access private
   */
  function remove_message_cache($key, $index)
  function remove_message_cache($key, $uid)
    {
    if (!$this->caching_enabled)
      return;
@@ -2445,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);
    }
  /**