summaryrefslogtreecommitdiff
path: root/program/lib/Roundcube/rcube_imap_search.php
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2014-05-15 13:57:18 +0200
committerAleksander Machniak <alec@alec.pl>2014-05-15 13:57:18 +0200
commit47a7833aca96a263068eed53f9471a3699ef257b (patch)
tree2f22545e2c005f115d99281130f3e81be8299187 /program/lib/Roundcube/rcube_imap_search.php
parent963499a17e98cdab4a6e872a711ce9badb8c3b0b (diff)
CS fixes
Diffstat (limited to 'program/lib/Roundcube/rcube_imap_search.php')
-rw-r--r--program/lib/Roundcube/rcube_imap_search.php25
1 files changed, 11 insertions, 14 deletions
diff --git a/program/lib/Roundcube/rcube_imap_search.php b/program/lib/Roundcube/rcube_imap_search.php
index 0c44daf1b..365d78f76 100644
--- a/program/lib/Roundcube/rcube_imap_search.php
+++ b/program/lib/Roundcube/rcube_imap_search.php
@@ -29,7 +29,7 @@ class rcube_imap_search
{
public $options = array();
- protected $jobs = array();
+ protected $jobs = array();
protected $timelimit = 0;
protected $results;
protected $conn;
@@ -40,7 +40,7 @@ class rcube_imap_search
public function __construct($options, $conn)
{
$this->options = $options;
- $this->conn = $conn;
+ $this->conn = $conn;
}
/**
@@ -54,7 +54,7 @@ class rcube_imap_search
*/
public function exec($folders, $str, $charset = null, $sort_field = null, $threading=null)
{
- $start = floor(microtime(true));
+ $start = floor(microtime(true));
$results = new rcube_result_multifolder($folders);
// start a search job for every folder to search in
@@ -65,7 +65,8 @@ class rcube_imap_search
$results->add($result);
}
else {
- $job = new rcube_imap_search_job($folder, $str, $charset, $sort_field, $threading);
+ $search = is_array($str) && $str[$folder] ? $str[$folder] : $str;
+ $job = new rcube_imap_search_job($folder, $search, $charset, $sort_field, $threading);
$job->worker = $this;
$this->jobs[] = $job;
}
@@ -129,11 +130,11 @@ class rcube_imap_search_job /* extends Stackable */
public function __construct($folder, $str, $charset = null, $sort_field = null, $threading=false)
{
- $this->folder = $folder;
- $this->search = $str;
- $this->charset = $charset;
+ $this->folder = $folder;
+ $this->search = $str;
+ $this->charset = $charset;
$this->sort_field = $sort_field;
- $this->threading = $threading;
+ $this->threading = $threading;
$this->result = new rcube_result_index($folder);
$this->result->incomplete = true;
@@ -150,9 +151,8 @@ class rcube_imap_search_job /* extends Stackable */
protected function search_index()
{
$criteria = $this->search;
- $charset = $this->charset;
-
- $imap = $this->worker->get_imap();
+ $charset = $this->charset;
+ $imap = $this->worker->get_imap();
if (!$imap->connected()) {
trigger_error("No IMAP connection for $this->folder", E_USER_WARNING);
@@ -228,7 +228,4 @@ class rcube_imap_search_job /* extends Stackable */
{
return $this->result;
}
-
}
-
-