Fix some issues with updating unseen count when flagging all new
authorMichael M Slusarz <slusarz@curecanti.org>
Sat, 18 Apr 2009 00:23:49 +0000 (18:23 -0600)
committerMichael M Slusarz <slusarz@curecanti.org>
Mon, 20 Apr 2009 19:47:30 +0000 (13:47 -0600)
imp/ajax.php
imp/js/src/DimpBase.js

index 47c160d..59ce90c 100644 (file)
@@ -122,7 +122,7 @@ function _getPollInformation($mbox)
     $elt = $imptree->get($mbox);
     if ($imptree->isPolled($elt)) {
         $info = $imptree->getElementInfo($mbox);
-        return array($mbox => isset($info['unseen']) ? $info['unseen'] : 0);
+        return array($mbox => isset($info['unseen']) ? intval($info['unseen']) : 0);
     }
     return array();
 }
@@ -277,11 +277,13 @@ case 'FlagAll':
         $result = new stdClass;
         $result->flags = $flags;
         $result->mbox = $mbox;
-        $result->set = intval($set);
+        if ($set) {
+            $result->set = 1;
+        }
 
         $poll = _getPollInformation($mbox);
         if (!empty($poll)) {
-            $result->poll = array($mbox => $poll[$mbox]['u']);
+            $result->poll = array($mbox => $poll[$mbox]);
         }
     }
     break;
index 92697c4..0ae1cf0 100644 (file)
@@ -1783,7 +1783,7 @@ var DimpBase = {
                     this.updateFlag(this.viewport.createSelection('rownum', $A($R(1, this.viewport.getMetaData('total_rows')))), f, r.response.set);
                 }, this);
             }
-            this.setFolderLabel(r.response.mbox, r.response.u);
+            this._pollCallback(r);
         }
     },