From 4ffa559227a2abecc12f8402b6ef99a06dfa4806 Mon Sep 17 00:00:00 2001 From: alecpl <alec@alec.pl> Date: Sat, 03 Mar 2012 08:20:14 -0500 Subject: [PATCH] - Apply fixes from trunk --- program/include/rcube_imap_generic.php | 16 ++++++++++------ 1 files changed, 10 insertions(+), 6 deletions(-) diff --git a/program/include/rcube_imap_generic.php b/program/include/rcube_imap_generic.php index e390b24..00802eb 100644 --- a/program/include/rcube_imap_generic.php +++ b/program/include/rcube_imap_generic.php @@ -2279,12 +2279,16 @@ $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') { -- Gitblit v1.9.1