From: Michael M Slusarz Date: Tue, 16 Dec 2008 07:42:50 +0000 (-0700) Subject: Fix for Ticket #7772 X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=38a62a0f82f516f5b9af509ff95c4ee3424a5a13;p=horde.git Fix for Ticket #7772 Don't track tree changes when they are a result of viewing unsubscribed/subscribed elements. --- diff --git a/imp/docs/CHANGES b/imp/docs/CHANGES index 338ad6516..50bee3113 100644 --- a/imp/docs/CHANGES +++ b/imp/docs/CHANGES @@ -36,6 +36,7 @@ v5.0-cvs v4.3.3-cvs ---------- +[mms] Fix tracking folder changes when renaming (Bug #7772). [cjh] Suppress browser autocomplete when redirecting messages (Bug #7767). diff --git a/imp/lib/IMAP/Tree.php b/imp/lib/IMAP/Tree.php index 725973d57..f4282663a 100644 --- a/imp/lib/IMAP/Tree.php +++ b/imp/lib/IMAP/Tree.php @@ -172,6 +172,13 @@ class IMP_IMAP_Tree protected $_eltdiff = null; /** + * If set, track element changes. + * + * @var boolean + */ + protected $_trackdiff = true; + + /** * See $open parameter in build(). * * @var boolean @@ -253,10 +260,11 @@ class IMP_IMAP_Tree * user MUST call reset() before cycling through the tree. * Don't store $_subscribed and $_fulllist - this information is * stored in the elements. - * Reset the $_changed flag. */ + * Reset the $_changed and $_trackdiff flags. */ $this->_currkey = $this->_currparent = $this->_eltdiff = $this->_expanded = $this->_fulllist = $this->_poll = $this->_subscribed = null; $this->_currstack = array(); $this->_changed = false; + $this->_trackdiff = true; return array_keys(get_class_vars(__CLASS__)); } @@ -746,14 +754,14 @@ class IMP_IMAP_Tree // This is a case where it is possible that the parent element has // changed (it now has children) but we can't catch it via the // bitflag (since hasChildren() is dynamically determined). - if (!is_null($this->_eltdiff)) { + if ($this->_trackdiff && !is_null($this->_eltdiff)) { $this->_eltdiff['c'][$elt['p']] = 1; } } $this->_parent[$elt['p']][] = $elt['v']; $this->_tree[$elt['v']] = $elt; - if (!is_null($this->_eltdiff)) { + if ($this->_trackdiff && !is_null($this->_eltdiff)) { $this->_eltdiff['a'][$elt['v']] = 1; } @@ -1323,7 +1331,9 @@ class IMP_IMAP_Tree * to add all unsubscribed elements that live in currently * discovered items. */ $this->_unsubview = true; + $this->_trackdiff = false; $this->insert($this->_getList(true)); + $this->_trackdiff = true; } /** @@ -1443,7 +1453,7 @@ class IMP_IMAP_Tree * Return the list of elements that have changed since eltDiffStart() * was last called. * - * @return array Returns false if no changes have ocurred, or an array + * @return array Returns false if no changes have occurred, or an array * with the following keys: *
      * 'a' => A list of elements that have been added.