When using sent subfolders, the special folder option is overruled because
authorjangliss <jangliss@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Thu, 17 Jul 2003 06:29:38 +0000 (06:29 +0000)
committerjangliss <jangliss@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Thu, 17 Jul 2003 06:29:38 +0000 (06:29 +0000)
the parent isn't marked as a special folder.  This code forces the parents
of the special folders to also be marked as special.  The rest of the subs
for the parent special should follow the movement of the parent in left_main

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

functions/imap_mailbox.php

index eb341c77ca3f7511fbc3ce804a95daadf1839de6..892c0f56528e739e4be1c055c90f7e180b2b3841 100755 (executable)
@@ -830,6 +830,13 @@ function sqimap_fill_mailbox_tree($mbx_ary, $mbxs=false,$imap_stream) {
         if ($mbx_ary[$i]['mbx'] !='' ) {
             $mbx = new mailboxes();
             $mailbox = $mbx_ary[$i]['mbx'];
+
+            /* @@@ FIXME @@@
+                sent subfolders messes up using existing code as subfolders
+                were marked, but the parents were ordered somewhere else in
+                the list, despite having "special folders at top" option set.
+                Need a better method than this.
+
             switch ($mailbox) {
                 case 'INBOX':
                     $mbx->is_inbox = true;
@@ -848,6 +855,24 @@ function sqimap_fill_mailbox_tree($mbx_ary, $mbxs=false,$imap_stream) {
                     $mbx->is_special = true;
                     break;
             }
+            
+            /FIXME/
+            */
+
+            if ($mailbox == 'INBOX') {
+                $mbx->is_inbox = true;
+                $mbx->is_special = true;
+            } elseif (stristr($trash_folder , $mailbox)) {
+                $mbx->is_trash = true;
+                $mbx->is_special = true;
+            } elseif (stristr($sent_folder , $mailbox)) {
+                $mbx->is_sent = true;
+                $mbx->is_special = true;
+            } elseif (stristr($draft_folder , $mailbox)) {
+                $mbx->is_draft = true;
+                $mbx->is_special = true;
+            }
+
 
             if (isset($mbx_ary[$i]['unseen'])) {
                 $mbx->unseen = $mbx_ary[$i]['unseen'];