summaryrefslogtreecommitdiff
path: root/roundcubemail/program/include
diff options
context:
space:
mode:
authoralec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c>2010-10-29 10:27:22 +0000
committeralec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c>2010-10-29 10:27:22 +0000
commit679ea2dbf072a0d40fa2a4e762cec2e39b28c57f (patch)
treebfc1acd257105bcecadb74dd235e70d5f24a4bc7 /roundcubemail/program/include
parentc2cfb1ad5433dc430901776dccc2da21174e04d2 (diff)
- Improve performance of clear_mailbox() when skip_deleted=true
git-svn-id: https://svn.roundcube.net/trunk@4158 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program/include')
-rw-r--r--roundcubemail/program/include/rcube_imap.php8
1 files changed, 3 insertions, 5 deletions
diff --git a/roundcubemail/program/include/rcube_imap.php b/roundcubemail/program/include/rcube_imap.php
index a4b18c970..ae53741eb 100644
--- a/roundcubemail/program/include/rcube_imap.php
+++ b/roundcubemail/program/include/rcube_imap.php
@@ -2620,14 +2620,12 @@ class rcube_imap
function clear_mailbox($mbox_name=NULL)
{
$mailbox = !empty($mbox_name) ? $this->mod_mailbox($mbox_name) : $this->mailbox;
- $msg_count = $this->_messagecount($mailbox, 'ALL');
- if (!$msg_count) {
- return 0;
+ // SELECT will set messages count for clearFolder()
+ if ($this->conn->select($mailbox)) {
+ $cleared = $this->conn->clearFolder($mailbox);
}
- $cleared = $this->conn->clearFolder($mailbox);
-
// make sure the message count cache is cleared as well
if ($cleared) {
$this->clear_message_cache($mailbox.'.msg');