From: Michael M Slusarz Date: Wed, 10 Dec 2008 23:07:11 +0000 (-0700) Subject: Only need to do this check if no messages in mbox. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=92429eb88c823a4a17e886b99b5a96b349f27d93;p=horde.git Only need to do this check if no messages in mbox. --- diff --git a/imp/lib/Views/ListMessages.php b/imp/lib/Views/ListMessages.php index 7627da884..e54794f62 100644 --- a/imp/lib/Views/ListMessages.php +++ b/imp/lib/Views/ListMessages.php @@ -97,26 +97,6 @@ class IMP_Views_ListMessages $result->label = $label; $result->cacheid = $imp_mailbox->getCacheID(); - /* Check for UIDVALIDITY expiration. It is the first element in the - * cacheid returned from the browser. If it has changed, we need to - * purge the cached items on the browser (send 'reset' param to - * ViewPort). */ - if (!empty($args['cacheid']) && !empty($args['cached'])) { - $uid_expire = false; - try { - $status = $GLOBALS['imp_imap']->ob->status($folder, Horde_Imap_Client::STATUS_UIDVALIDITY); - list($old_uidvalid,) = explode('|', $args['cacheid']); - $uid_expire = ($old_uidvalid != $status['uidvalidity']); - } catch (Horde_Imap_Cache_Exception $e) { - $uid_expire = true; - } - - if ($uid_expire) { - $args['cached'] = array(); - $result->reset = 1; - } - } - /* Determine the row slice to process. */ if (isset($args['slice_rownum'])) { $rownum = max(1, $args['slice_rownum']); @@ -174,6 +154,26 @@ class IMP_Views_ListMessages return $result; } + /* Check for UIDVALIDITY expiration. It is the first element in the + * cacheid returned from the browser. If it has changed, we need to + * purge the cached items on the browser (send 'reset' param to + * ViewPort). */ + if (!empty($args['cacheid']) && !empty($args['cached'])) { + $uid_expire = false; + try { + $status = $GLOBALS['imp_imap']->ob->status($folder, Horde_Imap_Client::STATUS_UIDVALIDITY); + list($old_uidvalid,) = explode('|', $args['cacheid']); + $uid_expire = ($old_uidvalid != $status['uidvalidity']); + } catch (Horde_Imap_Cache_Exception $e) { + $uid_expire = true; + } + + if ($uid_expire) { + $args['cached'] = array(); + $result->reset = 1; + } + } + /* Get the cached list. */ if (empty($args['cached'])) { $cached = array();