Better location to put this.
authorMichael M Slusarz <slusarz@curecanti.org>
Fri, 27 Mar 2009 01:15:53 +0000 (19:15 -0600)
committerMichael M Slusarz <slusarz@curecanti.org>
Fri, 27 Mar 2009 01:15:53 +0000 (19:15 -0600)
Prevents some unnecessary EXAMINE calls.

imp/mailbox.php

index 3c1a8ba..6bc57ab 100644 (file)
@@ -72,12 +72,6 @@ if (!empty($conf['hooks']['mbox_redirect'])) {
 $search_mbox = $imp_search->isSearchMbox();
 $vfolder = $imp_search->isVFolder();
 
-/* We know we are going to be exclusively dealing with this mailbox, so
- * select it on the IMAP server (saves some STATUS calls). */
-if (!$search_mbox) {
-    $imp_imap->ob->openMailbox($imp_mbox['mailbox']);
-}
-
 /* There is a chance that this page is loaded directly via message.php. If so,
  * don't re-include config files, and the following variables will already be
  * set: $actionID, $start. */
@@ -227,6 +221,12 @@ case 'login_compose':
     break;
 }
 
+/* We know we are going to be exclusively dealing with this mailbox, so
+ * select it on the IMAP server (saves some STATUS calls). */
+if (!$search_mbox) {
+    $imp_imap->ob->openMailbox($imp_mbox['mailbox']);
+}
+
 /* Token to use in requests */
 $mailbox_token = IMP::getRequestToken('imp.mailbox');