diff options
| author | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2012-03-02 13:43:45 +0000 |
|---|---|---|
| committer | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2012-03-02 13:43:45 +0000 |
| commit | 26f583cf5bc998f17e7e8091184fda833a569f0c (patch) | |
| tree | 3e7265a1600b1d6385346e6ed3c03a9c72d06a41 /roundcubemail/program/include/rcube_imap_generic.php | |
| parent | 72a2a653b7c68f01afd5be7b6e6a13d8fc5a6662 (diff) | |
- Fix automatic unsubscribe of non-existent folders (with small perf fix)
git-svn-id: https://svn.roundcube.net/trunk@5946 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program/include/rcube_imap_generic.php')
| -rw-r--r-- | roundcubemail/program/include/rcube_imap_generic.php | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/roundcubemail/program/include/rcube_imap_generic.php b/roundcubemail/program/include/rcube_imap_generic.php index 2d636f027..cffb250fb 100644 --- a/roundcubemail/program/include/rcube_imap_generic.php +++ b/roundcubemail/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') { |
