浏览代码

When using sent subfolders, the special folder option is overruled because
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

jangliss 22 年之前
父节点
当前提交
206f1e8c13
共有 1 个文件被更改,包括 25 次插入0 次删除
  1. 25 0
      functions/imap_mailbox.php

+ 25 - 0
functions/imap_mailbox.php

@@ -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'];