changeset 82:1eb0cdd17c76 noffle

[svn] info-always-unread config/doc/implementation
author bears
date Sun, 14 May 2000 17:15:08 +0100
parents 8b4e3f9e9e4e
children cea3ea783f5d
files docs/noffle.conf.5 src/configfile.c src/configfile.h src/server.c
diffstat 4 files changed, 50 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- a/docs/noffle.conf.5	Sun May 14 17:13:21 2000 +0100
+++ b/docs/noffle.conf.5	Sun May 14 17:15:08 2000 +0100
@@ -1,5 +1,5 @@
 .TH noffle.conf 5
-.\" $Id: noffle.conf.5 51 2000-05-05 23:49:38Z uh1763 $
+.\" $Id: noffle.conf.5 88 2000-05-14 16:15:08Z bears $
 .SH NAME
 noffle.conf \- Configuration file for NOFFLE news server
 
@@ -95,6 +95,18 @@
 Default: over
 
 .TP
+.B info-always-unread yes|no
+An information article is presented for all unsubscribed
+newsgroups. If auto-subscribe mode is off, there is a possibility of
+someone reading the article but forgetting the instructions therein
+and not knowing how to return to a read article. This option causes
+the information article always to be present as an unread article in a
+group when auto-subscribe if off. It does this by incrementing the
+article number of the information article every time it is read.
+.br
+Default: yes
+
+.TP
 .B remove-messageid yes|no
 Remove Message-ID from posted articles. Some remote servers can generate
 Message-IDs.
--- a/src/configfile.c	Sun May 14 17:13:21 2000 +0100
+++ b/src/configfile.c	Sun May 14 17:15:08 2000 +0100
@@ -6,7 +6,7 @@
     SPOOLDIR
     VERSION
 
-  $Id: configfile.c 60 2000-05-09 22:28:38Z uh1763 $
+  $Id: configfile.c 88 2000-05-14 16:15:08Z bears $
 */
 
 #if HAVE_CONFIG_H
@@ -47,6 +47,7 @@
     int connectTimeout;
     Bool autoSubscribe;
     Bool autoUnsubscribe;
+    Bool infoAlways;
     Bool removeMsgId;
     Bool replaceMsgId;
     Str autoSubscribeMode;
@@ -70,6 +71,7 @@
     30,       /* connectTimeout */
     FALSE,    /* autoSubscribe */
     FALSE,    /* autoUnsubscribe */
+    TRUE,     /* infoAlways */
     FALSE,    /* removeMsgId */
     TRUE,     /* replaceMsgId */
     "over",   /* autoSubscribeMode */
@@ -94,6 +96,7 @@
 int Cfg_connectTimeout( void ) { return config.connectTimeout; }
 Bool Cfg_autoUnsubscribe( void ) { return config.autoUnsubscribe; }
 Bool Cfg_autoSubscribe( void )  { return config.autoSubscribe; }
+Bool Cfg_infoAlways( void )  { return config.infoAlways; }
 Bool Cfg_removeMsgId( void ) { return config.removeMsgId; }
 Bool Cfg_replaceMsgId( void ) { return config.replaceMsgId; }
 const char * Cfg_autoSubscribeMode( void ) {
@@ -362,6 +365,8 @@
             getBool( &config.autoSubscribe, p );
         else if ( strcmp( "auto-unsubscribe", name ) == 0 )
             getBool( &config.autoUnsubscribe, p );
+        else if ( strcmp( "info-always-unread", name ) == 0 )
+            getBool( &config.infoAlways, p );
         else if ( strcmp( "remove-messageid", name ) == 0 )
             getBool( &config.removeMsgId, p );
         else if ( strcmp( "replace-messageid", name ) == 0 )
--- a/src/configfile.h	Sun May 14 17:13:21 2000 +0100
+++ b/src/configfile.h	Sun May 14 17:15:08 2000 +0100
@@ -3,7 +3,7 @@
 
   Common declarations and handling of the configuration file.
 
-  $Id: configfile.h 51 2000-05-05 23:49:38Z uh1763 $
+  $Id: configfile.h 88 2000-05-14 16:15:08Z bears $
 */
 
 #ifndef CONFIGFILE_H
@@ -24,6 +24,7 @@
 int Cfg_connectTimeout( void );
 Bool Cfg_autoUnsubscribe( void );
 Bool Cfg_autoSubscribe( void );
+Bool Cfg_infoAlways( void );
 Bool Cfg_removeMsgId( void );
 Bool Cfg_replaceMsgId( void );
 const char * Cfg_autoSubscribeMode( void ); /* Can be: full, thread, over */
--- a/src/server.c	Sun May 14 17:13:21 2000 +0100
+++ b/src/server.c	Sun May 14 17:15:08 2000 +0100
@@ -1,7 +1,7 @@
 /*
   server.c
 
-  $Id: server.c 80 2000-05-13 15:36:35Z bears $
+  $Id: server.c 88 2000-05-14 16:15:08Z bears $
 */
 
 #if HAVE_CONFIG_H
@@ -124,21 +124,37 @@
     FetchMode mode;
 
     Grp_setLastAccess( server.grp, time( NULL ) );
-    if ( ! Grp_local ( server.grp ) && Cfg_autoSubscribe() && ! Online_true() )
+    if ( ! Grp_local ( server.grp ) && ! Online_true() )
     {
         Fetchlist_read();
         if ( ! Fetchlist_contains( server.grp ) )
-        {
-            if ( strcmp( Cfg_autoSubscribeMode(), "full" ) == 0 )
-                mode = FULL;
-            else if ( strcmp( Cfg_autoSubscribeMode(), "thread" ) == 0 )
-                mode = THREAD;
-            else
-                mode = OVER;
-            Fetchlist_add( server.grp, mode );
-            Fetchlist_write();
-            Pseudo_autoSubscribed();
-        }
+	{
+	    if ( Cfg_autoSubscribe() )
+	    {
+		if ( strcmp( Cfg_autoSubscribeMode(), "full" ) == 0 )
+		    mode = FULL;
+		else if ( strcmp( Cfg_autoSubscribeMode(), "thread" ) == 0 )
+		    mode = THREAD;
+		else
+		    mode = OVER;
+		Fetchlist_add( server.grp, mode );
+		Fetchlist_write();
+		Pseudo_autoSubscribed();
+	    }
+	    else if ( Cfg_infoAlways() )
+	    {
+		int first, last;
+
+		/* Ensure new gen info for next time */
+		first = Cont_first();
+		last = Cont_last();
+
+		if ( first == last )
+		    first = last + 1;
+		
+		Grp_setFirstLast( Cont_grp(), first, last );
+	    }
+	}
     }
 }