diff options
Diffstat (limited to 'program')
-rw-r--r-- | program/lib/Roundcube/rcube_result_multifolder.php | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/program/lib/Roundcube/rcube_result_multifolder.php b/program/lib/Roundcube/rcube_result_multifolder.php index 277a6d1ea..188fb26f2 100644 --- a/program/lib/Roundcube/rcube_result_multifolder.php +++ b/program/lib/Roundcube/rcube_result_multifolder.php @@ -52,8 +52,15 @@ class rcube_result_multifolder */ public function add($result) { - $this->sets[] = $result; - $this->meta['count'] += $result->count(); + if ($count = $result->count()) { + $this->sets[] = $result; + $this->meta['count'] += $count; + + // append UIDs to global index + $folder = $result->get_parameters('MAILBOX'); + $index = array_map(function($uid) use ($folder) { return $uid . '-' . $folder; }, $result->get()); + $this->index = array_merge($this->index, $index); + } } /** |