summaryrefslogtreecommitdiff
path: root/program/lib
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2014-08-18 10:46:18 -0400
committerAleksander Machniak <alec@alec.pl>2014-08-18 10:46:18 -0400
commitfb5e2fb96f4cda26936f599f1a15a49afb53178e (patch)
treed5afbeb5be78411f1276769856e26a4acac5bc64 /program/lib
parent674a037d2a6cef13fc9e229157ba97f140bb2384 (diff)
Don't fail when trying to create and subscribe a folder that already exists
Diffstat (limited to 'program/lib')
-rw-r--r--program/lib/Roundcube/rcube_imap.php10
1 files changed, 10 insertions, 0 deletions
diff --git a/program/lib/Roundcube/rcube_imap.php b/program/lib/Roundcube/rcube_imap.php
index ec961c8d1..a66d2064d 100644
--- a/program/lib/Roundcube/rcube_imap.php
+++ b/program/lib/Roundcube/rcube_imap.php
@@ -3165,6 +3165,16 @@ class rcube_imap extends rcube_storage
$result = $this->conn->createFolder($folder, $type ? array("\\" . ucfirst($type)) : null);
+ // it's quite often situation that we're trying to create and subscribe
+ // a folder that already exist, but is unsubscribed
+ if (!$result) {
+ if ($this->get_response_code() == rcube_storage::ALREADYEXISTS
+ || preg_match('/already exists/i', $this->get_error_str())
+ ) {
+ $result = true;
+ }
+ }
+
// try to subscribe it
if ($result) {
// clear cache