summaryrefslogtreecommitdiff
path: root/program/include/rcube_imap.php
diff options
context:
space:
mode:
authoralecpl <alec@alec.pl>2010-12-03 12:25:49 +0000
committeralecpl <alec@alec.pl>2010-12-03 12:25:49 +0000
commite232acbfde30e27101f84da7f0a617f8a8522512 (patch)
treeebc5aee2db28601d4a62a3412d02c3c711e13330 /program/include/rcube_imap.php
parentc0c0c03d97c7d7d7157c34c17f2fcddbb2533d32 (diff)
- Improve performance of moving or copying of all messages in a folder (use CLOSE intead of EXPUNGE)
- Code cleanup + added more phpdoc comments
Diffstat (limited to 'program/include/rcube_imap.php')
-rw-r--r--program/include/rcube_imap.php15
1 files changed, 10 insertions, 5 deletions
diff --git a/program/include/rcube_imap.php b/program/include/rcube_imap.php
index dd9f81b86..bf88c2991 100644
--- a/program/include/rcube_imap.php
+++ b/program/include/rcube_imap.php
@@ -185,7 +185,7 @@ class rcube_imap
*/
function close()
{
- $this->conn->close();
+ $this->conn->closeConnection();
$this->write_cache();
}
@@ -198,7 +198,7 @@ class rcube_imap
*/
function reconnect()
{
- $this->close();
+ $this->closeConnection();
$this->connect($this->host, $this->user, $this->pass, $this->port, $this->ssl);
// issue SELECT command to restore connection status
@@ -617,7 +617,7 @@ class rcube_imap
}
// RECENT count is fetched a bit different
else if ($mode == 'RECENT') {
- $count = $this->conn->checkForRecent($mailbox);
+ $count = $this->conn->countRecent($mailbox);
}
// use SEARCH for message counting
else if ($this->skip_deleted) {
@@ -2582,6 +2582,7 @@ class rcube_imap
// send expunge command in order to have the moved message
// really deleted from the source mailbox
+$aa = rcube_timer();
if ($moved) {
$this->_expunge($from_mbox, false, $uids);
$this->_clear_messagecount($from_mbox);
@@ -2591,7 +2592,7 @@ class rcube_imap
else if ($config->get('delete_always', false) && $tbox == $config->get('trash_mbox')) {
$moved = $this->delete_message($uids, $fbox);
}
-
+rcube_print_time($aa);
if ($moved) {
// unset threads internal cache
unset($this->icache['threads']);
@@ -2774,7 +2775,11 @@ class rcube_imap
else
$a_uids = NULL;
- $result = $this->conn->expunge($mailbox, $a_uids);
+ // CLOSE(+SELECT) should be faster than EXPUNGE
+ if (empty($a_uids) || $a_uids == '1:*')
+ $result = $this->conn->close();
+ else
+ $result = $this->conn->expunge($mailbox, $a_uids);
if ($result && $clear_cache) {
$this->clear_message_cache($mailbox.'.msg');