From 40c45e9de99186eda203a925c09424a3a8ec103c Mon Sep 17 00:00:00 2001
From: alecpl <alec@alec.pl>
Date: Wed, 07 Dec 2011 03:44:48 -0500
Subject: [PATCH] - Fixed issues with big memory allocation of IMAP results, improved a lot of rcube_imap class

---
 program/steps/mail/search.inc |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/program/steps/mail/search.inc b/program/steps/mail/search.inc
index 49f31e0..05ba9d2 100644
--- a/program/steps/mail/search.inc
+++ b/program/steps/mail/search.inc
@@ -109,10 +109,6 @@
 if ($search_str)
   $IMAP->search($mbox, $search_str, $imap_charset, $_SESSION['sort_col']);
 
-// Get the headers
-$result_h = $IMAP->list_headers($mbox, 1, $_SESSION['sort_col'], $_SESSION['sort_order']);
-$count = $IMAP->messagecount(NULL, $IMAP->threading ? 'THREADS' : 'ALL');
-
 // save search results in session
 if (!is_array($_SESSION['search']))
   $_SESSION['search'] = array();
@@ -123,6 +119,12 @@
 }
 $_SESSION['search_request'] = $search_request;
 
+
+// Get the headers
+$result_h = $IMAP->list_headers($mbox, 1, $_SESSION['sort_col'], $_SESSION['sort_order']);
+$count = $IMAP->messagecount($mbox, $IMAP->threading ? 'THREADS' : 'ALL');
+
+
 // Make sure we got the headers
 if (!empty($result_h)) {
   rcmail_js_message_list($result_h);

--
Gitblit v1.9.1