Skip to content

Commit

Permalink
Don't fail when trying to create and subscribe a folder that already …
Browse files Browse the repository at this point in the history
…exists
  • Loading branch information
alecpl committed Aug 18, 2014
1 parent 674a037 commit fb5e2fb
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions program/lib/Roundcube/rcube_imap.php
Original file line number Diff line number Diff line change
Expand Up @@ -3165,6 +3165,16 @@ public function create_folder($folder, $subscribe = false, $type = null)

$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
Expand Down

0 comments on commit fb5e2fb

Please sign in to comment.