X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=banana%2Fspool.inc.php;h=73641e6865a7542612f95c4684866fca857a1bde;hb=4d20320e192fe7cf4228555825f5532fcd36d1b0;hp=8bb553759083aa9298951cf40a388b3bc33291c6;hpb=7972645bb364b21a1b23d8818bb1ca6f45d36d93;p=banana.git diff --git a/banana/spool.inc.php b/banana/spool.inc.php index 8bb5537..73641e6 100644 --- a/banana/spool.inc.php +++ b/banana/spool.inc.php @@ -85,10 +85,10 @@ class BananaSpool $this->group = $group; } - public static function getSpool($group, $since = 0) + public static function getSpool($group, $since = 0, $clean = false) { if (!is_null(Banana::$spool) && Banana::$spool->group == $group) { - $spool = Banana::$spool; + $spool =& Banana::$spool; } else { $spool = BananaSpool::readFromFile($group); } @@ -97,6 +97,9 @@ class BananaSpool } Banana::$spool =& $spool; $spool->build(); + if ($clean) { + $spool->markAllAsRead(); + } $spool->updateUnread($since); return $spool; } @@ -243,7 +246,7 @@ class BananaSpool } $newpostsids = Banana::$protocole->getNewIndexes($since); - + if (empty($newpostsids)) { return; } @@ -518,7 +521,7 @@ class BananaSpool for ($i = 0; $i < $pos ; $i++) { $ndx += $this->overview[$this->overview[$id_parent]->children[$i]]->desc; } - $ndx++; //noeud père + $ndx++; //noeud père $id_cur = $id_parent; } @@ -687,5 +690,5 @@ class BananaSpool } } -// vim:set et sw=4 sts=4 ts=4 +// vim:set et sw=4 sts=4 ts=4 enc=utf-8: ?>