From: Michael M Slusarz Date: Mon, 30 Nov 2009 06:19:24 +0000 (-0700) Subject: Improvements to mailbox list caching in IMP X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=9d30b3c000dfa1b9aa6e046d34829fb72ebcc949;p=horde.git Improvements to mailbox list caching in IMP --- diff --git a/imp/lib/Mailbox.php b/imp/lib/Mailbox.php index 1d43bf265..c3f478955 100644 --- a/imp/lib/Mailbox.php +++ b/imp/lib/Mailbox.php @@ -64,6 +64,13 @@ class IMP_Mailbox protected $_threadob = null; /** + * Has the internal message list changed? + * + * @var boolean + */ + protected $_changed = false; + + /** * Attempts to return a reference to a concrete IMP_Mailbox instance. * It will only create a new instance if no IMP_Mailbox instance with * the same parameters currently exists. @@ -119,7 +126,8 @@ class IMP_Mailbox */ public function shutdown() { - if (!is_null($this->_arrayIndex)) { + if ($this->_changed && + ($_SESSION['imp']['view'] == 'imp')) { /* Casting $_sorted to integers saves a significant amount of * space when json_encoding (no need to quote every value). Only * can do for IMAP though (since POP3 UIDs are not limited to @@ -308,6 +316,7 @@ class IMP_Mailbox return; } + $this->_changed = true; $query = null; if ($this->_searchmbox) { @@ -786,6 +795,7 @@ class IMP_Mailbox } $this->_sorted = array_values($this->_sorted); + $this->_changed = true; if ($this->_searchmbox) { $this->_sortedMbox = array_values($this->_sortedMbox); }