Removed double select call (select calls are expensive, do not do that) and
authorstekkel <stekkel@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Fri, 14 May 2004 19:55:10 +0000 (19:55 +0000)
committerstekkel <stekkel@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Fri, 14 May 2004 19:55:10 +0000 (19:55 +0000)
removed unneeded expunge call (don't do that expunges are expensive)

git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@7460 7612ce4b-ef26-0410-bec9-ea0150e637f0

functions/mailbox_display.php
src/right_main.php

index 107d2d968f0e2a8c8d662b7808b5838e54754359..a48daf4c00d570db9caecc0bb2d7cbfaf1c7c5cb 100644 (file)
@@ -532,7 +532,7 @@ function getSelfSortMessages($imapConnection, $start_msg, $show_num,
  */
 function showMessagesForMailbox($imapConnection, $mailbox, $num_msgs,
                                 $start_msg, $sort, $color, $show_num,
-                                $use_cache, $mode='') {
+                                $use_cache, $mode='',$mbxresponse) {
     global $msgs, $msort, $auto_expunge, $thread_sort_messages,
            $allow_server_sort, $server_sort_order;
 
@@ -552,14 +552,14 @@ function showMessagesForMailbox($imapConnection, $mailbox, $num_msgs,
 
     //$start = microtime();
     /* If autoexpunge is turned on, then do it now. */
-    $mbxresponse = sqimap_mailbox_select($imapConnection, $mailbox);
+    //$mbxresponse = sqimap_mailbox_select($imapConnection, $mailbox);
     $srt = $sort;
     /* If autoexpunge is turned on, then do it now. */
-    if ($auto_expunge == true) {
-        $exp_cnt = sqimap_mailbox_expunge($imapConnection, $mailbox, false, '');
-        $mbxresponse['EXISTS'] = $mbxresponse['EXISTS'] - $exp_cnt;
-        $num_msgs = $mbxresponse['EXISTS'];
-    }
+    //if ($auto_expunge == true) {
+    //    $exp_cnt = sqimap_mailbox_expunge($imapConnection, $mailbox, false, '');
+    //    $mbxresponse['EXISTS'] = $mbxresponse['EXISTS'] - $exp_cnt;
+    //    $num_msgs = $mbxresponse['EXISTS'];
+    //}
 
     if ($mbxresponse['EXISTS'] > 0) {
         /* if $start_msg is lower than $num_msgs, we probably deleted all messages
index 27dd05f0509383b24cfafc551c1b8a3caefa6ec0..53840768c4bfe43cc72d85124fbca99306f472ac 100644 (file)
@@ -151,7 +151,7 @@ else {
 
 do_hook ('generic_header');
 
-sqimap_mailbox_select($imapConnection, $mailbox);
+$aMbxResponse = sqimap_mailbox_select($imapConnection, $mailbox);
 
 if ($composenew) {
     $comp_uri = SM_PATH . 'src/compose.php?mailbox='. urlencode($mailbox).
@@ -203,7 +203,9 @@ if (! isset($use_mailbox_cache)) {
 }
 
 if ($use_mailbox_cache && sqsession_is_registered('msgs')) {
-    showMessagesForMailbox($imapConnection, $mailbox, $numMessages, $startMessage, $sort, $color, $show_num, $use_mailbox_cache);
+    showMessagesForMailbox($imapConnection, $mailbox, $numMessages, 
+                           $startMessage, $sort, $color, $show_num, 
+                           $use_mailbox_cache, '',$aMbxResponse);
 } else {
     if (sqsession_is_registered('msgs')) {
         unset($msgs);
@@ -221,7 +223,7 @@ if ($use_mailbox_cache && sqsession_is_registered('msgs')) {
 
     showMessagesForMailbox($imapConnection, $mailbox, $numMessages,
                            $startMessage, $sort, $color, $show_num,
-                           $use_mailbox_cache);
+                           $use_mailbox_cache,'',$aMbxResponse);
 
     if (sqsession_is_registered('msgs') && isset($msgs)) {
         sqsession_register($msgs, 'msgs');