From 6913c0ae86cf7e4f1cee74932089b5f250744c09 Mon Sep 17 00:00:00 2001
From: Aleksander Machniak <alec@alec.pl>
Date: Sun, 30 Jun 2013 05:30:32 -0400
Subject: [PATCH] Fix message list sort with THREADS=REFS and sort column other than "None" or "Sent date"

---
 program/lib/Roundcube/rcube_imap.php |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/program/lib/Roundcube/rcube_imap.php b/program/lib/Roundcube/rcube_imap.php
index 869fa9e..356f4f1 100644
--- a/program/lib/Roundcube/rcube_imap.php
+++ b/program/lib/Roundcube/rcube_imap.php
@@ -1336,7 +1336,7 @@
         // THREAD=REFERENCES:     sorting by sent date of root message
         // THREAD=REFS:           sorting by the most recent date in each thread
 
-        if ($this->threading != 'REFS') {
+        if ($this->threading != 'REFS' || ($this->sort_field && $this->sort_field != 'date')) {
             $sortby = $this->sort_field ? $this->sort_field : 'date';
             $index  = $this->index_direct($this->folder, $sortby, $this->sort_order, false);
 

--
Gitblit v1.9.1