diff options
author | alecpl <alec@alec.pl> | 2010-06-04 10:06:10 +0000 |
---|---|---|
committer | alecpl <alec@alec.pl> | 2010-06-04 10:06:10 +0000 |
commit | ccf250ec1d0a979e878769cb87d939c970fc863a (patch) | |
tree | 621bc53af07aedce922bda6e20defe44fa89d857 /program/include | |
parent | 309f49f09bc8b663a3ddf834ca0e79f909a0928c (diff) |
- performance improvement: we can skip THREAD when folder is empty
Diffstat (limited to 'program/include')
-rw-r--r-- | program/include/rcube_imap_generic.php | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/program/include/rcube_imap_generic.php b/program/include/rcube_imap_generic.php index ab37902ae..411e1d396 100644 --- a/program/include/rcube_imap_generic.php +++ b/program/include/rcube_imap_generic.php @@ -1552,8 +1552,15 @@ class rcube_imap_generic function thread($folder, $algorithm='REFERENCES', $criteria='', $encoding='US-ASCII') { + $old_sel = $this->selected; + if (!$this->select($folder)) { - return false; + return false; + } + + // return empty result when folder is empty and we're just after SELECT + if ($old_sel != $folder && !$this->exists) { + return array(array(), array(), array()); } $encoding = $encoding ? trim($encoding) : 'US-ASCII'; |