* Support for LIST-SUBSCRIBED capability.
authorstekkel <stekkel@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Wed, 16 Nov 2005 16:35:57 +0000 (16:35 +0000)
committerstekkel <stekkel@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Wed, 16 Nov 2005 16:35:57 +0000 (16:35 +0000)
* Do not do an individual LIST call for each mailbox if all mailboxes are
displayed instead of only the subscribed ones.

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

functions/imap_mailbox.php

index a1a00fa20add70cf9fada4e38ace996f8e59fc53..a5e50c7f0402f5e115cd7cbd67259461a8c7437e 100755 (executable)
@@ -744,7 +744,7 @@ function sqimap_mailbox_list($imap_stream, $force=false) {
            * in other words, we cannot rely on it.
          */
         $sorted_list_ary = array();
//       if (!$listsubscribed) {
       if (!$listsubscribed && $show_only_subscribed_folders) {
           for ($i=0; $i < count($sorted_lsub_ary); $i++) {
             if (substr($sorted_lsub_ary[$i], -1) == $delimiter) {
                 $mbx = substr($sorted_lsub_ary[$i], 0, strlen($sorted_lsub_ary[$i])-1);
@@ -764,7 +764,9 @@ function sqimap_mailbox_list($imap_stream, $force=false) {
                 $sorted_list_ary[$i] = '';
             }
           }
- //       }
+        } else {
+          $sorted_list_ary = $sorted_lsub_ary;
+        }
         /*
          * Just in case they're not subscribed to their inbox,
          * we'll get it for them anyway