| | |
| | | $this->threading = false; |
| | | |
| | | $searcher = new rcube_imap_search($this->options, $this->conn); |
| | | |
| | | // set limit to not exceed the client's request timeout |
| | | $searcher->set_timelimit(60); |
| | | |
| | | // continue existing incomplete search |
| | | if (!empty($this->search_set) && $this->search_set->incomplete && $str == $this->search_string) { |
| | | $searcher->set_results($this->search_set); |
| | | } |
| | | |
| | | // execute the search |
| | | $results = $searcher->exec( |
| | | $folder, |
| | | $str, |
| | |
| | | } |
| | | |
| | | return $this->get_search_set(); |
| | | } |
| | | |
| | | /** |
| | | * Flag certain result subsets as 'incomplete'. |
| | | * For subsequent refresh_search() calls to only refresh the updated parts. |
| | | */ |
| | | protected function set_search_dirty($folder) |
| | | { |
| | | if ($this->search_set && is_a($this->search_set, 'rcube_result_multifolder')) { |
| | | if ($subset = $this->search_set->get_set($folder)) { |
| | | $subset->incomplete = $this->search_set->incomplete = true; |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | |
| | | $this->clear_message_cache($folder, $all_mode ? null : explode(',', $uids)); |
| | | } |
| | | } |
| | | |
| | | $this->set_search_dirty($folder); |
| | | } |
| | | |
| | | return $result; |
| | |
| | | if ($moved) { |
| | | $this->clear_messagecount($from_mbox); |
| | | $this->clear_messagecount($to_mbox); |
| | | |
| | | $this->set_search_dirty($from_mbox); |
| | | $this->set_search_dirty($to_mbox); |
| | | } |
| | | // moving failed |
| | | else if ($to_trash && $config->get('delete_always', false)) { |
| | |
| | | if ($this->search_threads || $all_mode) { |
| | | $this->refresh_search(); |
| | | } |
| | | else { |
| | | else if (!$this->search_set->incomplete) { |
| | | $this->search_set->filter(explode(',', $uids), $this->folder); |
| | | } |
| | | } |
| | |
| | | // unset threads internal cache |
| | | unset($this->icache['threads']); |
| | | |
| | | $this->set_search_dirty($folder); |
| | | |
| | | // remove message ids from search set |
| | | if ($this->search_set && $folder == $this->folder) { |
| | | // threads are too complicated to just remove messages from set |
| | | if ($this->search_threads || $all_mode) { |
| | | $this->refresh_search(); |
| | | } |
| | | else { |
| | | else if (!$this->search_set->incomplete) { |
| | | $this->search_set->filter(explode(',', $uids)); |
| | | } |
| | | } |