summaryrefslogtreecommitdiff
path: root/program/include
diff options
context:
space:
mode:
authoralecpl <alec@alec.pl>2009-05-10 08:59:39 +0000
committeralecpl <alec@alec.pl>2009-05-10 08:59:39 +0000
commit91ec0a0559b907af5c125face53440675e2323c9 (patch)
tree54ab35e0158d8b3e83ab292a7c8f4bcdeda34e32 /program/include
parent4769ead5e8fa2cbee61ac6675d499cb16d7ffb7c (diff)
- speed up remove_message_cache() by using message uid instead of idx
Diffstat (limited to 'program/include')
-rw-r--r--program/include/rcube_imap.php16
1 files changed, 8 insertions, 8 deletions
diff --git a/program/include/rcube_imap.php b/program/include/rcube_imap.php
index 4073c8a63..3ff0f3fe8 100644
--- a/program/include/rcube_imap.php
+++ b/program/include/rcube_imap.php
@@ -796,7 +796,7 @@ class rcube_imap
{
// 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 @@ class rcube_imap
// 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 @@ class rcube_imap
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 @@ class rcube_imap
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 @@ class rcube_imap
{
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 @@ class rcube_imap
/**
* @access private
*/
- function remove_message_cache($key, $index)
+ function remove_message_cache($key, $uid)
{
if (!$this->caching_enabled)
return;
@@ -2439,10 +2439,10 @@ class rcube_imap
"DELETE FROM ".get_table_name('messages')."
WHERE user_id=?
AND cache_key=?
- AND idx=?",
+ AND uid=?",
$_SESSION['user_id'],
$key,
- $index);
+ $uid);
}
/**