summaryrefslogtreecommitdiff
path: root/program/include/rcube_imap_generic.php
diff options
context:
space:
mode:
authoralecpl <alec@alec.pl>2012-03-02 13:43:45 +0000
committeralecpl <alec@alec.pl>2012-03-02 13:43:45 +0000
commitc6a9cd679970c61e097bfc6d73ca861cdc985fe3 (patch)
tree783f444a7674dc0411af4e9f8ba44be0188a2355 /program/include/rcube_imap_generic.php
parent82d69583fdef54e70189d3f8eae2d2175ff5b5e2 (diff)
- Fix automatic unsubscribe of non-existent folders (with small perf fix)
Diffstat (limited to 'program/include/rcube_imap_generic.php')
-rw-r--r--program/include/rcube_imap_generic.php16
1 files changed, 10 insertions, 6 deletions
diff --git a/program/include/rcube_imap_generic.php b/program/include/rcube_imap_generic.php
index 2d636f027..cffb250fb 100644
--- a/program/include/rcube_imap_generic.php
+++ b/program/include/rcube_imap_generic.php
@@ -1352,12 +1352,16 @@ class rcube_imap_generic
$folders[$mailbox] = array();
}
- // Add to options array
- if (empty($this->data['LIST'][$mailbox]))
- $this->data['LIST'][$mailbox] = $opts;
- else if (!empty($opts))
- $this->data['LIST'][$mailbox] = array_unique(array_merge(
- $this->data['LIST'][$mailbox], $opts));
+ // store LSUB options only if not empty, this way
+ // we can detect a situation when LIST doesn't return specified folder
+ if (!empty($opts) || $cmd == 'LIST') {
+ // Add to options array
+ if (empty($this->data['LIST'][$mailbox]))
+ $this->data['LIST'][$mailbox] = $opts;
+ else if (!empty($opts))
+ $this->data['LIST'][$mailbox] = array_unique(array_merge(
+ $this->data['LIST'][$mailbox], $opts));
+ }
}
// * STATUS <mailbox> (<result>)
else if ($cmd == 'STATUS') {