diff --git a/lib/Mailbox.php b/lib/Mailbox.php index 1983c070c..77a3a9cae 100644 --- a/lib/Mailbox.php +++ b/lib/Mailbox.php @@ -960,6 +960,10 @@ public function subscribe($sub, array $opts = []) $notify = $sub ? sprintf(_('You were successfully subscribed to "%s" and all subfolders.'), $this->display) : sprintf(_('You were successfully unsubscribed from "%s" and all subfolders.'), $this->display); + } else { + $notify = $sub + ? sprintf(_('You were successfully subscribed to "%s".'), $this->display) + : sprintf(_('You were successfully unsubscribed from "%s".'), $this->display); } } diff --git a/lib/Search/Query.php b/lib/Search/Query.php index 7863fe0ce..f0d5dbdaa 100644 --- a/lib/Search/Query.php +++ b/lib/Search/Query.php @@ -209,7 +209,16 @@ public function __get($name) } } - $this->_cache['mboxes'] = array_unique($out, SORT_REGULAR); + $mboxes = []; + foreach ($out as $mbox) { + if (!$mbox instanceof IMP_Mailbox) { + $mbox = IMP_Mailbox::get($mbox); + } + if ($mbox) { + $mboxes[strval($mbox)] = $mbox; + } + } + $this->_cache['mboxes'] = array_values($mboxes); } return $this->_cache['mboxes'];