summaryrefslogtreecommitdiff
path: root/program/include
diff options
context:
space:
mode:
Diffstat (limited to 'program/include')
-rw-r--r--program/include/rcube_imap.php8
1 files changed, 3 insertions, 5 deletions
diff --git a/program/include/rcube_imap.php b/program/include/rcube_imap.php
index a4b18c970..ae53741eb 100644
--- a/program/include/rcube_imap.php
+++ b/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');