First index to show must be a linear index and not a message number
authorx2003bruneau <x2003bruneau@9869982d-c50d-0410-be91-f2a2ec7c7c7b>
Sun, 23 Jul 2006 15:41:59 +0000 (15:41 +0000)
committerFlorent Bruneau <florent.bruneau@polytechnique.org>
Fri, 4 Jan 2008 23:35:05 +0000 (00:35 +0100)
git-svn-id: svn+ssh://murphy/home/svn/banana/trunk@124 9869982d-c50d-0410-be91-f2a2ec7c7c7b

banana/banana.inc.php.in

index 25ac4c5..bbec034 100644 (file)
@@ -316,10 +316,14 @@ class Banana
              . "\n"
              . "Message canceled with Banana";
         if ($this->nntp->post($msg)) {
+            $ndx = $this->spool->getndx($artid) - 1;
+            if ($ndx > 50) {
+                $ndx = 0;
+            }
             $this->spool->delid($id);
             $this->nntp->quit();
             redirectInBanana(Array('group' => $group,
-                                   'first' => $id));
+                                   'first' => $ndx));
         } else {
             return '<p class="error">'._b_('Impossible d\'annuler le message').'</p>';
         }
@@ -475,7 +479,10 @@ class Banana
         if ($this->nntp->post($msg)) {
             $dir = Array('group' => $group);
             if ($artid != -1) {
-                $dir['first'] = $artid;
+                $ndx = $this->spool->getndx($artid);
+                if ($ndx > 50) {
+                    $dir['first'] = $ndx;
+                }
             }
             redirectInBanana($dir);
         } else {