mirror of
https://github.com/roundcube/roundcubemail.git
synced 2026-03-09 17:46:51 +01:00
- Improve performance of clear_mailbox() when skip_deleted=true
This commit is contained in:
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user