From 049ba0aed21590dbbc3286d68b45a7f46d28b142 Mon Sep 17 00:00:00 2001
From: Aleksander Machniak <alec@alec.pl>
Date: Sun, 30 Jun 2013 05:29:24 -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 6b30a5c..7ef8d62 100644
--- a/program/lib/Roundcube/rcube_imap.php
+++ b/program/lib/Roundcube/rcube_imap.php
@@ -1370,7 +1370,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($this->folder, $sortby, $this->sort_order, true, true);
 

--
Gitblit v1.9.1