Removed kind of insane check. The check mailbox is subscribed call retrieved
authorstekkel <stekkel@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Mon, 17 May 2004 15:45:37 +0000 (15:45 +0000)
committerstekkel <stekkel@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Mon, 17 May 2004 15:45:37 +0000 (15:45 +0000)
the whole subscription list and looked up if the requested mailbox was part
of it. It's better to subscribe and surpress the NO response if already
subscribed.

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

functions/imap_mailbox.php
src/left_main.php

index 1deb9bc74030687dd875f2b6e6840fb0b68fdbac..41ea2b761d1e45646d57d5739e702dd8d916882b 100755 (executable)
@@ -367,10 +367,10 @@ function sqimap_mailbox_create ($imap_stream, $mailbox, $type) {
 /**
  * Subscribes to an existing folder.
  */
-function sqimap_subscribe ($imap_stream, $mailbox) {
+function sqimap_subscribe ($imap_stream, $mailbox,$debug=true) {
     $read_ary = sqimap_run_command($imap_stream, 'SUBSCRIBE ' .
                                    sqimap_encode_mailbox_name($mailbox),
-                                   true, $response, $message);
+                                   $debug, $response, $message);
 }
 
 /**
@@ -609,6 +609,7 @@ function sqimap_mailbox_option_list($imap_stream, $show_selected = 0, $folder_sk
  * See comment on sqimap_mailbox_parse() for info about the returned array.
  */
 function sqimap_mailbox_list($imap_stream) {
+    echo "TEST<BR>";
     global $default_folder_prefix;
 
     if (!isset($boxesnew)) {
index 505d2bcd02461dfd96ae59c7358e5fd3b48a8bfd..39c3b9d89143d8e83205053d587be3f19c4fcc2b 100644 (file)
@@ -924,7 +924,7 @@ ECHO;
 }
 
 displayHtmlHeader( 'SquirrelMail', $xtra );
-
+sqgetGlobalVar('auto_create_done',$auto_create_done,SQ_SESSION);
 /* If requested and not yet complete, attempt to autocreate folders. */
 if ($auto_create_special && !isset($auto_create_done)) {
     $autocreate = array($sent_folder, $trash_folder, $draft_folder);
@@ -932,8 +932,11 @@ if ($auto_create_special && !isset($auto_create_done)) {
         if (($folder != '') && ($folder != 'none')) {
             if ( !sqimap_mailbox_exists($imapConnection, $folder)) {
                 sqimap_mailbox_create($imapConnection, $folder, '');
-            } else if (!sqimap_mailbox_is_subscribed($imapConnection, $folder)) {
-                sqimap_subscribe($imapConnection, $folder);
+            } else {
+                //if (!sqimap_mailbox_is_subscribed($imapConnection, $folder)) {
+                // check for subscription is useless and expensive  just 
+                // surpress the NO response
+                sqimap_subscribe($imapConnection, $folder, false);
             }
         }
     }