summaryrefslogtreecommitdiff
path: root/program/include
diff options
context:
space:
mode:
authorsvncommit <devs@roundcube.net>2007-10-15 09:17:08 +0000
committersvncommit <devs@roundcube.net>2007-10-15 09:17:08 +0000
commit97a656643866f16289264954be961aa3f314ac20 (patch)
tree84848c4778e41a58566a1afed585795e9580aca7 /program/include
parent092bc0bca51ce7830f413c600789ddc89981da67 (diff)
When a parent folder is deleted, delete the children immediately, instead of one-by-one as r833 did.
Diffstat (limited to 'program/include')
-rw-r--r--program/include/rcube_imap.inc11
1 files changed, 11 insertions, 0 deletions
diff --git a/program/include/rcube_imap.inc b/program/include/rcube_imap.inc
index 3fe5b1c11..9eb359457 100644
--- a/program/include/rcube_imap.inc
+++ b/program/include/rcube_imap.inc
@@ -1739,6 +1739,8 @@ class rcube_imap
else if (is_string($mbox_name) && strlen($mbox_name))
$a_mboxes = explode(',', $mbox_name);
+ $all_mboxes = iil_C_ListMailboxes($this->conn, $this->_mod_mailbox($root), '*');
+
if (is_array($a_mboxes))
foreach ($a_mboxes as $mbox_name)
{
@@ -1751,6 +1753,15 @@ class rcube_imap
$result = iil_C_DeleteFolder($this->conn, $mailbox);
if ($result>=0)
$deleted = TRUE;
+
+ foreach ($all_mboxes as $c_mbox)
+ if (preg_match('/^'.preg_quote($mailbox.$this->delimiter).'/', $c_mbox))
+ {
+ iil_C_UnSubscribe($this->conn, $c_mbox);
+ $result = iil_C_DeleteFolder($this->conn, $c_mbox);
+ if ($result>=0)
+ $deleted = TRUE;
+ }
}
// clear mailboxlist cache