summaryrefslogtreecommitdiff
path: root/program/steps/mail/search.inc
diff options
context:
space:
mode:
authoralecpl <alec@alec.pl>2011-12-07 08:44:48 +0000
committeralecpl <alec@alec.pl>2011-12-07 08:44:48 +0000
commit40c45e9de99186eda203a925c09424a3a8ec103c (patch)
tree66d59cf5b1aeb38a701976aed8aa97cbb6f00576 /program/steps/mail/search.inc
parent86130d6366a18cf3d558d64f67bcf410ff5f0fc2 (diff)
- Fixed issues with big memory allocation of IMAP results, improved a lot of rcube_imap class
Diffstat (limited to 'program/steps/mail/search.inc')
-rw-r--r--program/steps/mail/search.inc10
1 files changed, 6 insertions, 4 deletions
diff --git a/program/steps/mail/search.inc b/program/steps/mail/search.inc
index 49f31e0c1..05ba9d23e 100644
--- a/program/steps/mail/search.inc
+++ b/program/steps/mail/search.inc
@@ -109,10 +109,6 @@ $search_str = trim($search_str);
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 @@ if ($search_str) {
}
$_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);