dimp folder add/remove fixes
authorMichael M Slusarz <slusarz@curecanti.org>
Wed, 4 Mar 2009 22:49:01 +0000 (15:49 -0700)
committerMichael M Slusarz <slusarz@curecanti.org>
Thu, 5 Mar 2009 04:09:45 +0000 (21:09 -0700)
imp/js/src/DimpBase.js
imp/lib/Imap/Tree.php

index 6df32fa..09e42fe 100644 (file)
@@ -2011,6 +2011,10 @@ var DimpBase = {
     deleteFolderElt: function(fid, sub)
     {
         var f = $(fid), submbox;
+        if (!f) {
+            return;
+        }
+
         if (sub) {
             submbox = $(this.getSubFolderId(fid));
             if (submbox) {
index bb6d473..f9cfd1e 100644 (file)
@@ -759,7 +759,9 @@ 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 ($this->_trackdiff && !is_null($this->_eltdiff)) {
+            if ($this->_trackdiff &&
+                !is_null($this->_eltdiff) &&
+                !isset($this->_eltdiff['a'][$elt['p']])) {
                 $this->_eltdiff['c'][$elt['p']] = 1;
             }
         }