summaryrefslogtreecommitdiff
path: root/program/lib/Roundcube/rcube_result_multifolder.php
diff options
context:
space:
mode:
authorThomas Bruederli <thomas@roundcube.net>2014-04-08 15:17:19 +0200
committerThomas Bruederli <thomas@roundcube.net>2014-04-08 15:17:19 +0200
commit94e797c1fbc5ae1ce3c57bdc5cdaabd3a9f8f911 (patch)
tree7abe5cbc3ff1a564ade6ffc4f59e9b8f377b5a96 /program/lib/Roundcube/rcube_result_multifolder.php
parent5aab24e5473566b6eda119a6ab0ba7e3e286366f (diff)
Consider sort order in UID sort mode of multi-folder search results
Diffstat (limited to 'program/lib/Roundcube/rcube_result_multifolder.php')
-rw-r--r--program/lib/Roundcube/rcube_result_multifolder.php11
1 files changed, 11 insertions, 0 deletions
diff --git a/program/lib/Roundcube/rcube_result_multifolder.php b/program/lib/Roundcube/rcube_result_multifolder.php
index 74a3d7805..b5473b841 100644
--- a/program/lib/Roundcube/rcube_result_multifolder.php
+++ b/program/lib/Roundcube/rcube_result_multifolder.php
@@ -130,6 +130,17 @@ class rcube_result_multifolder
public function revert()
{
$this->order = $this->order == 'ASC' ? 'DESC' : 'ASC';
+ $this->index = array();
+
+ // revert order in all sub-sets
+ foreach ($this->sets as $set) {
+ if ($this->order != $set->get_parameters('ORDER')) {
+ $set->revert();
+ }
+ $folder = $set->get_parameters('MAILBOX');
+ $index = array_map(function($uid) use ($folder) { return $uid . '-' . $folder; }, $set->get());
+ $this->index = array_merge($this->index, $index);
+ }
}