summaryrefslogtreecommitdiff
path: root/program
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2013-06-13 08:20:54 +0200
committerAleksander Machniak <alec@alec.pl>2013-06-13 08:23:11 +0200
commit35b0a75f72ef1c7c83bf2ad8ba01f6ac1a444122 (patch)
treec69f5c7afd938e49db18e4768fbbd74208ca7f09 /program
parent04f841e90079464a9870a0a0a83b3ee2925a9adb (diff)
Fix default sorting of threaded list when THREAD=REFS isn't supported.
The result need to be re-sorted even if sort column is not set. This fixes the issue when new messages aren't displayed on top of the list.
Diffstat (limited to 'program')
-rw-r--r--program/lib/Roundcube/rcube_imap.php11
1 files changed, 5 insertions, 6 deletions
diff --git a/program/lib/Roundcube/rcube_imap.php b/program/lib/Roundcube/rcube_imap.php
index b68c3d353..a323a84e4 100644
--- a/program/lib/Roundcube/rcube_imap.php
+++ b/program/lib/Roundcube/rcube_imap.php
@@ -1336,17 +1336,16 @@ class rcube_imap extends rcube_storage
// THREAD=REFERENCES: sorting by sent date of root message
// THREAD=REFS: sorting by the most recent date in each thread
- if ($this->sort_field && ($this->sort_field != 'date' || $this->get_capability('THREAD') != 'REFS')) {
- $index = $this->index_direct($this->folder, $this->sort_field, $this->sort_order, false);
+ if ($this->get_capability('THREAD') != 'REFS') {
+ $sortby = $this->sort_field ? $this->sort_field : 'date';
+ $index = $this->index_direct($this->folder, $sortby, $this->sort_order, false);
if (!$index->is_empty()) {
$threads->sort($index);
}
}
- else {
- if ($this->sort_order != $threads->get_parameters('ORDER')) {
- $threads->revert();
- }
+ else if ($this->sort_order != $threads->get_parameters('ORDER')) {
+ $threads->revert();
}
}