Cache header search for x-priority and list-post
authorMichael M Slusarz <slusarz@curecanti.org>
Tue, 1 Dec 2009 05:29:50 +0000 (22:29 -0700)
committerMichael M Slusarz <slusarz@curecanti.org>
Tue, 1 Dec 2009 05:29:50 +0000 (22:29 -0700)
imp/lib/Mailbox.php
imp/lib/Views/ListMessages.php
imp/mailbox-mimp.php
imp/mailbox.php

index c3f4789..6e6773b 100644 (file)
@@ -157,9 +157,9 @@ class IMP_Mailbox
      * @param array $msgnum   An array of message sequence numbers.
      * @param array $options  Additional options:
      * <pre>
-     * 'headers' - (array) A list of non-standard (non-envelope) headers to
-     *             return.
-     *             DEFAULT: Only envelope headers returned.
+     * 'headers' - (boolean) Return info on the non-envelope headers
+     *             'List-Post' and 'X-Priority'.
+     *             DEFAULT: false (only envelope headers returned)
      * 'preview' - (mixed) Include preview information?  If empty, add no
      *                     preview information. If 1, uses value from prefs.
      *                     If 2, forces addition of preview info.
@@ -225,7 +225,7 @@ class IMP_Mailbox
         );
 
         if (!empty($options['headers'])) {
-            $fetch_criteria[Horde_Imap_Client::FETCH_HEADERS] = array(array('headers' => $options['headers'], 'label' => 'imp', 'parse' => true, 'peek' => true));
+            $fetch_criteria[Horde_Imap_Client::FETCH_HEADERS] = array(array('cache' => true, 'headers' => array('list-post', 'x-priority'), 'label' => 'imp', 'parse' => true, 'peek' => true));
         }
 
         if (!empty($options['structure'])) {
index 5cf732e..58c176c 100644 (file)
@@ -268,7 +268,7 @@ class IMP_Views_ListMessages
         }
 
         /* Get mailbox information. */
-        $overview = $imp_mailbox->getMailboxArray($msglist, array('headers' => array('list-post', 'x-priority'), 'structure' => $GLOBALS['prefs']->getValue('atc_flag')));
+        $overview = $imp_mailbox->getMailboxArray($msglist, array('headers' => true, 'structure' => $GLOBALS['prefs']->getValue('atc_flag')));
         $charset = Horde_Nls::getCharset();
         $imp_ui = new IMP_Ui_Mailbox($folder);
         $no_flags_hook = false;
index 2805226..d769827 100644 (file)
@@ -112,7 +112,7 @@ $sortpref = IMP::getSort($imp_mbox['mailbox']);
 $imp_ui = new IMP_Ui_Mailbox($imp_mbox['mailbox']);
 
 /* Build the array of message information. */
-$mbox_info = $imp_mailbox->getMailboxArray(range($pageOb['begin'], $pageOb['end']), array('headers' => array('x-priority')));
+$mbox_info = $imp_mailbox->getMailboxArray(range($pageOb['begin'], $pageOb['end']), array('headers' => true));
 
 /* Get thread information. */
 if ($sortpref['by'] == Horde_Imap_Client::SORT_THREAD) {
index c162f67..7df04dd 100644 (file)
@@ -231,8 +231,7 @@ $imp_mailbox = IMP_Mailbox::singleton($imp_mbox['mailbox']);
 $pageOb = $imp_mailbox->buildMailboxPage(Horde_Util::getFormData('page'), $start);
 $show_preview = $prefs->getValue('preview_enabled');
 
-$overview_headers = array('x-priority');
-$mbox_info = $imp_mailbox->getMailboxArray(range($pageOb['begin'], $pageOb['end']), array('preview' => $show_preview, 'headers' => $overview_headers, 'structure' => $prefs->getValue('atc_flag')));
+$mbox_info = $imp_mailbox->getMailboxArray(range($pageOb['begin'], $pageOb['end']), array('preview' => $show_preview, 'headers' => true, 'structure' => $prefs->getValue('atc_flag')));
 
 /* Determine sorting preferences. */
 $sortpref = IMP::getSort($imp_mbox['mailbox']);