Преглед изворни кода

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