From: Michael M Slusarz Date: Mon, 13 Sep 2010 04:14:00 +0000 (-0600) Subject: Move update poll preference code to a single location X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=1fc6efae4658fe3aa6227f8dd9d9550c65447d4e;p=horde.git Move update poll preference code to a single location --- diff --git a/imp/lib/Imap/Tree.php b/imp/lib/Imap/Tree.php index 2d6da34c2..28f6419cc 100644 --- a/imp/lib/Imap/Tree.php +++ b/imp/lib/Imap/Tree.php @@ -1029,9 +1029,7 @@ class IMP_Imap_Tree implements ArrayAccess, Iterator, Serializable } if ($changed) { - $GLOBALS['prefs']->setValue('nav_poll', serialize($this->_cache['poll'])); - $GLOBALS['injector']->getInstance('IMP_Search')->createVINBOXFolder(); - $this->changed = true; + $this->_updatePollList(); } } @@ -1065,13 +1063,21 @@ class IMP_Imap_Tree implements ArrayAccess, Iterator, Serializable } if ($removed) { - $GLOBALS['prefs']->setValue('nav_poll', serialize($this->_cache['poll'])); - $GLOBALS['injector']->getInstance('IMP_Search')->createVINBOXFolder(); - $this->changed = true; + $this->_updatePollList(); } } /** + * Update the nav_poll preference. + */ + protected function _updatePollList() + { + $GLOBALS['prefs']->setValue('nav_poll', serialize($this->_cache['poll'])); + $GLOBALS['injector']->getInstance('IMP_Search')->createVInbox(); + $this->changed = true; + } + + /** * Does the user want to poll this mailbox for new/unseen messages? * * @param array $elt A tree element.