* fix for messageheader caching. We didn't cache somebody broke it :(
authorstekkel <stekkel@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Wed, 11 Jun 2003 17:26:52 +0000 (17:26 +0000)
committerstekkel <stekkel@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Wed, 11 Jun 2003 17:26:52 +0000 (17:26 +0000)
* 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

index 426609ed4aef42d66cdb22ea75721201eade1f94..efce2944c4773bddd1000a677778ad4a1807467b 100644 (file)
@@ -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);