From 7b73b80945f13488c27f3dd5f4911a598db1449b Mon Sep 17 00:00:00 2001 From: stekkel Date: Wed, 11 Jun 2003 17:26:52 +0000 Subject: [PATCH] * fix for messageheader caching. We didn't cache somebody broke it :( * fix for very large msgs_str genered by sqimap_msg_squisher. We don't need that if we want to fetch the whole list (1:*) Now the imapserver doesn't return BYE because of the size of the imap request git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@4996 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- functions/mailbox_display.php | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/functions/mailbox_display.php b/functions/mailbox_display.php index 426609ed..efce2944 100644 --- a/functions/mailbox_display.php +++ b/functions/mailbox_display.php @@ -320,6 +320,9 @@ function getSelfSortMessages($imapConnection, $start_msg, $show_num, if ($sort < 6 ) { $end = $num_msgs; $end_loop = $end; + /* set shownum to 999999 to fool sqimap_get_small_header_list + and rebuild the msgs_str to 1:* */ + $show_num = 999999; } else { /* if it's not sorted */ if ($start_msg + ($show_num - 1) < $num_msgs) { @@ -411,8 +414,13 @@ function showMessagesForMailbox($imapConnection, $mailbox, $num_msgs, $mode = ''; } - sqsession_unregister('msort'); - sqsession_unregister('msgs'); + if ($use_cache) { + sqgetGlobalVar('msgs', $msgs, SQ_SESSION); + sqgetGlobalVar('msort', $msort, SQ_SESSION); + } else { + sqsession_unregister('msort'); + sqsession_unregister('msgs'); + } switch ($mode) { case 'thread': $id = get_thread_sort($imapConnection); @@ -454,6 +462,7 @@ function showMessagesForMailbox($imapConnection, $mailbox, $num_msgs, } // switch sqsession_register($msort, 'msort'); sqsession_register($msgs, 'msgs'); + } /* if exists > 0 */ $res = getEndMessage($start_msg, $show_num, $num_msgs); -- 2.25.1