diff src/content.c @ 75:22b3e3dfc8c2 noffle

[svn] Preserve gen info sometimes
author bears
date Sat, 13 May 2000 16:38:39 +0100
parents e612b263934f
children 988cacc01470
line wrap: on
line diff
--- a/src/content.c	Sat May 13 16:36:35 2000 +0100
+++ b/src/content.c	Sat May 13 16:38:39 2000 +0100
@@ -1,7 +1,7 @@
 /*
   content.c
 
-  $Id: content.c 65 2000-05-12 16:52:41Z enz $
+  $Id: content.c 81 2000-05-13 15:38:39Z bears $
 */
 
 #if HAVE_CONFIG_H
@@ -172,7 +172,7 @@
     Bool anythingWritten;
     int i;
     FILE *f;
-    const Over *ov;
+    const Over *ov, *ov_next;
 
     /* Save the overview */
     if ( ! ( f = fopen( cont.file, "w" ) ) )
@@ -185,9 +185,24 @@
     cont.first = -1;
     for ( i = 0; i < cont.size; ++i )
     {
-        if ( ( ov = cont.elem[ i ] ) )
+	ov = cont.elem[ i ];
+        if ( ov )
         {
-            if ( ! Pseudo_isGeneralInfo( Ov_msgId( ov ) ) )
+	    if ( i + 1 < cont.size )
+		ov_next = cont.elem[ i + 1 ];
+	    else
+		ov_next = NULL;
+	
+	    /*
+	      Preserve gen info if it is followed immediately by an
+	      article with the next number. In practice, this means
+	      that when in auto-subscribed mode, the gen info will
+	      remain until the 'group now subscribed' message is
+	      expired.
+	     */
+            if ( ! Pseudo_isGeneralInfo( Ov_msgId( ov ) )
+		 || ( ov_next != NULL &&
+		      Ov_numb( ov_next ) - Ov_numb( ov ) == 1 ) )
             {
                 if ( ! Ov_write( ov, f ) )
                 {