optimizations
authorMichael M Slusarz <slusarz@curecanti.org>
Mon, 1 Feb 2010 05:18:08 +0000 (22:18 -0700)
committerMichael M Slusarz <slusarz@curecanti.org>
Mon, 1 Feb 2010 05:18:08 +0000 (22:18 -0700)
imp/lib/Ajax/Application.php

index 85c774d..5cbf1e3 100644 (file)
@@ -1663,7 +1663,8 @@ class IMP_Ajax_Application extends Horde_Ajax_Application_Base
      * </pre>
      * @param boolean $rw            Open mailbox as READ+WRITE?
      *
-     * @return boolean  True if the cache information has changed.
+     * @return boolean  True if the server state differs from the browser
+     *                  state.
      */
     protected function _changed($vars, $rw = null)
     {
@@ -1674,8 +1675,7 @@ class IMP_Ajax_Application extends Horde_Ajax_Application_Base
 
         /* We know we are going to be dealing with this mailbox, so select it
          * on the IMAP server (saves some STATUS calls). */
-        if (!is_null($rw) &&
-            !$GLOBALS['imp_search']->isSearchMbox($vars->view)) {
+        if (!is_null($rw)) {
             try {
                 $GLOBALS['imp_imap']->ob()->openMailbox($vars->view, $rw ? Horde_Imap_Client::OPEN_READWRITE : Horde_Imap_Client::OPEN_AUTO);
             } catch (Horde_Imap_Client_Exception $e) {
@@ -1684,8 +1684,7 @@ class IMP_Ajax_Application extends Horde_Ajax_Application_Base
             }
         }
 
-        $imp_mailbox = IMP_Mailbox::singleton($vars->view);
-        return ($imp_mailbox->getCacheID($vars->view) != $vars->cacheid);
+        return (IMP_Mailbox::singleton($vars->view)->getCacheID($vars->view) != $vars->cacheid);
     }
 
     /**