Thomas Bruederli
2014-01-20 689a222170aed32165cbe8bc8fc89fd428b29186
Append per-folder search results to global index but only if it has matches
1 files modified
11 ■■■■ changed files
program/lib/Roundcube/rcube_result_multifolder.php 11 ●●●● patch | view | raw | blame | history
program/lib/Roundcube/rcube_result_multifolder.php
@@ -52,8 +52,15 @@
     */
    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);
        }
    }
    /**