Fix deletion of message from spool
[banana.git] / banana / spool.inc.php
index 361a43c..172e4aa 100644 (file)
@@ -364,9 +364,13 @@ class BananaSpool
             }
             unset($this->overview[$_id]);
             $msgid = array_search($_id, $this->ids);
-            if ($msgid) {
+            if ($msgid !== false) {
                 unset($this->ids[$msgid]);
             }
+            $msgid = array_search($_id, $this->roots);
+            if ($msgid !== false) {
+                unset($this->roots[$msgid]);
+            }
             
             if ($write) {
                 $this->markAllAsRead();