Bugfix : non régénération du spool si tous les messages actuellement enregistrÃ...
[banana.git] / banana / spool.inc.php
index 2df59e4..00f787c 100644 (file)
@@ -100,16 +100,16 @@ class BananaSpool
 
         $do_save = false;
         $first   = $banana->maxspool ? max($groupinfo[2]-$banana->maxspool, $groupinfo[1]) : $groupinfo[1];
-        $last    = $groupinfo[2];
+        $last    = $groupinfo[2];        
         if ($this->version == BANANA_SPOOL_VERSION && is_array($this->overview)) {
-            for ($id = min(array_keys($this->overview)); $id<$first; $id++) { 
-                $this->delid($id, false);
-                $do_save = true;
+            if (count($this->overview)) {
+                for ($id = min(array_keys($this->overview)); $id<$first; $id++) { 
+                    $this->delid($id, false);
+                    $do_save = true;
+                }
             }
             if (!empty($this->overview)) {
                 $first = max(array_keys($this->overview))+1;
-            } else {
-                return;
             }
         } else {
             unset($this->overview, $this->ids);
@@ -145,7 +145,7 @@ class BananaSpool
                 $this->roots[] = $id;
             }
         }
-        
+
         file_put_contents($file, serialize($this));
     }
 
@@ -326,10 +326,14 @@ class BananaSpool
             $res .= "<td class='subj'>"
                 ."<div class='tree'>$_pfx_node".($hc?($_head?$spfx_f:($this->overview[$_id]->parent_direct?$spfx_s:$spfx_snd)):$spfx_n)
                 ."</div>";
+            $subject = $this->overview[$_id]->subject;
+            if (strlen($subject) == 0) {
+                $subject = _b_('(pas de sujet)');
+            }
             if ($_index == $_ref) {
-                $res .= '<span class="cur">'.htmlentities($this->overview[$_id]->subject).'</span>';
+                $res .= '<span class="cur">'.htmlentities($subject).'</span>';
             } else {
-                $res .= "<a href='?group={$this->group}&amp;artid=$_id'>".htmlentities($this->overview[$_id]->subject).'</a>';
+                $res .= "<a href='?group={$this->group}&amp;artid=$_id'>".htmlentities($subject).'</a>';
             }
             $res .= "</td>\n<td class='from'>".formatFrom($this->overview[$_id]->from)."</td>\n</tr>";