From 188304872066eef4b20c305f9cd6ea939dd419e0 Mon Sep 17 00:00:00 2001
From: Thomas Bruederli <thomas@roundcube.net>
Date: Tue, 08 Apr 2014 04:58:56 -0400
Subject: [PATCH] Optimize header fetching of multi-folder searches with natural (UID) sorting

---
 program/steps/mail/search.inc |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/program/steps/mail/search.inc b/program/steps/mail/search.inc
index 797c8fc..c97e3ac 100644
--- a/program/steps/mail/search.inc
+++ b/program/steps/mail/search.inc
@@ -108,7 +108,8 @@
 
     // search all, current or subfolders folders
     if ($scope == 'all') {
-        $mboxes = $RCMAIL->storage->list_folders_subscribed('', '*', 'mail');
+        $mboxes = $RCMAIL->storage->list_folders_subscribed('', '*', 'mail', null, true);
+        natcasesort($mboxes);  // we want natural alphabetic sorting of folders in the result set
     }
     else if ($scope == 'sub') {
         $mboxes = $RCMAIL->storage->list_folders_subscribed($mbox, '*', 'mail');

--
Gitblit v1.9.1