From 6a40022587889b13f869dca13cc56426157685ac Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Mon, 30 Nov 2009 22:29:50 -0700 Subject: [PATCH] Cache header search for x-priority and list-post --- imp/lib/Mailbox.php | 8 ++++---- imp/lib/Views/ListMessages.php | 2 +- imp/mailbox-mimp.php | 2 +- imp/mailbox.php | 3 +-- 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/imp/lib/Mailbox.php b/imp/lib/Mailbox.php index c3f478955..6e6773b9f 100644 --- a/imp/lib/Mailbox.php +++ b/imp/lib/Mailbox.php @@ -157,9 +157,9 @@ class IMP_Mailbox * @param array $msgnum An array of message sequence numbers. * @param array $options Additional options: *
-     * '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'])) {
diff --git a/imp/lib/Views/ListMessages.php b/imp/lib/Views/ListMessages.php
index 5cf732eef..58c176c83 100644
--- a/imp/lib/Views/ListMessages.php
+++ b/imp/lib/Views/ListMessages.php
@@ -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;
diff --git a/imp/mailbox-mimp.php b/imp/mailbox-mimp.php
index 28052264b..d76982747 100644
--- a/imp/mailbox-mimp.php
+++ b/imp/mailbox-mimp.php
@@ -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) {
diff --git a/imp/mailbox.php b/imp/mailbox.php
index c162f672e..7df04ddd7 100644
--- a/imp/mailbox.php
+++ b/imp/mailbox.php
@@ -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']);
-- 
2.11.0