summaryrefslogtreecommitdiff
path: root/program/include/rcube_imap.php
diff options
context:
space:
mode:
authoralecpl <alec@alec.pl>2010-05-03 06:41:57 +0000
committeralecpl <alec@alec.pl>2010-05-03 06:41:57 +0000
commit16378fe3a255943c7b2f374443158670a0eedf86 (patch)
tree8d6bf74481e477d6210002db0d929688685074e5 /program/include/rcube_imap.php
parente0950945910b95f07b26a43575f8bad5938b7124 (diff)
- preformance fix: don't load full folders list when checking for folder
existance in sendmail.inc, use internal cache to make mailbox_exists() faster when called more than one time for the same folder
Diffstat (limited to 'program/include/rcube_imap.php')
-rw-r--r--program/include/rcube_imap.php5
1 files changed, 5 insertions, 0 deletions
diff --git a/program/include/rcube_imap.php b/program/include/rcube_imap.php
index 9db6427b2..6e4d9890e 100644
--- a/program/include/rcube_imap.php
+++ b/program/include/rcube_imap.php
@@ -2774,6 +2774,10 @@ class rcube_imap
if ($mbox_name == 'INBOX')
return true;
+ $key = $subscription ? 'subscribed' : 'existing';
+ if (is_array($this->icache[$key]) && in_array($mbox_name, $this->icache[$key]))
+ return true;
+
if ($subscription) {
$a_folders = $this->conn->listSubscribed($this->mod_mailbox(''), $mbox_name);
}
@@ -2782,6 +2786,7 @@ class rcube_imap
}
if (is_array($a_folders) && in_array($this->mod_mailbox($mbox_name), $a_folders)) {
+ $this->icache[$key][] = $mbox_name;
return true;
}
}