summaryrefslogtreecommitdiff
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:20:54 +0200
commit918a6a6e0e2b18766ccc2cba49c2fade7e3d5168 (patch)
treee1aef89af825bcfce0997df66492191013064e57
parent9ac4006d647a3f74cab296618d90630cb42777de (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.
-rw-r--r--CHANGELOG1
-rw-r--r--program/lib/Roundcube/rcube_imap.php11
2 files changed, 6 insertions, 6 deletions
diff --git a/CHANGELOG b/CHANGELOG
index 9043ce230..23085d4f7 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,6 +1,7 @@
CHANGELOG Roundcube Webmail
===========================
+- Fix default sorting of threaded list when THREAD=REFS isn't supported
- Fix list mode switch to 'List' after saving list settings in Larry skin (#1489164)
- Fix error when there's no writeable addressbook source (#1489162)
- Add option show_real_foldernames to disable localization of special folders
diff --git a/program/lib/Roundcube/rcube_imap.php b/program/lib/Roundcube/rcube_imap.php
index 0a84f8d08..73158c388 100644
--- a/program/lib/Roundcube/rcube_imap.php
+++ b/program/lib/Roundcube/rcube_imap.php
@@ -1335,17 +1335,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();
}
}