changeset 237:f8a91e2b4060 noffle

[svn] * src/fetchlist.h,src/fetchlist.c,src/noffle.c: Provide fetchmode for groups on fetchlist. * src/server.c: When fetching overviews online from groups on the fetchlist, fetch them in the appropriate fetch mode for the group. E.g. if group mode is FULL, fetch overviews and put all articles on articles required list to be fetched on the next noffle --fetch.
author bears
date Thu, 14 Feb 2002 17:14:34 +0000
parents 5ebb557435b2
children dbafa3954bbe
files src/fetchlist.c src/fetchlist.h src/noffle.c src/server.c
diffstat 4 files changed, 28 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/src/fetchlist.c	Thu Feb 14 17:14:06 2002 +0000
+++ b/src/fetchlist.c	Thu Feb 14 17:14:34 2002 +0000
@@ -1,7 +1,7 @@
 /*
   fetchlist.c
 
-  $Id: fetchlist.c 363 2002-02-08 17:06:01Z bears $
+  $Id: fetchlist.c 368 2002-02-14 17:14:34Z bears $
 */
 
 #if HAVE_CONFIG_H
@@ -202,9 +202,14 @@
 }
 
 Bool
-Fetchlist_contains( const char *name )
+Fetchlist_contains( const char *name, FetchMode *mode )
 {
-    return ( searchElem( name ) != NULL );
+    struct Elem *elem = searchElem( name );
+    if ( elem == NULL )
+	return FALSE;
+    if ( mode != NULL )
+	*mode = elem->mode;
+    return TRUE;
 }
 
 Bool
--- a/src/fetchlist.h	Thu Feb 14 17:14:06 2002 +0000
+++ b/src/fetchlist.h	Thu Feb 14 17:14:34 2002 +0000
@@ -3,7 +3,7 @@
 
   List of groups that are to be fetched presently.
 
-  $Id: fetchlist.h 67 2000-05-12 17:19:38Z enz $
+  $Id: fetchlist.h 368 2002-02-14 17:14:34Z bears $
 */
 
 #ifndef FETCHLIST_H
@@ -28,7 +28,7 @@
 Fetchlist_size( void );
 
 Bool
-Fetchlist_contains( const char *name );
+Fetchlist_contains( const char *name, FetchMode *mode );
 
 /* Get element number index. */
 Bool
--- a/src/noffle.c	Thu Feb 14 17:14:06 2002 +0000
+++ b/src/noffle.c	Thu Feb 14 17:14:34 2002 +0000
@@ -10,7 +10,7 @@
   received for some seconds (to allow multiple clients connect at the same
   time).
 
-  $Id: noffle.c 358 2001-12-18 15:27:08Z mirkol $
+  $Id: noffle.c 368 2002-02-14 17:14:34Z bears $
 */
 
 #if HAVE_CONFIG_H
@@ -281,7 +281,7 @@
 	     * there's been nothing to read.
 	     */
             if ( ! Grp_local( grp )
-                 && Fetchlist_contains( grp )
+                 && Fetchlist_contains( grp, NULL )
                  && autoUnsubscribe
                  && difftime( Grp_lastPostTime(grp),
 			      Grp_lastAccess( grp ) ) > maxAge )
--- a/src/server.c	Thu Feb 14 17:14:06 2002 +0000
+++ b/src/server.c	Thu Feb 14 17:14:34 2002 +0000
@@ -1,7 +1,7 @@
 /*
   server.c
 
-  $Id: server.c 342 2001-12-09 12:31:57Z bears $
+  $Id: server.c 368 2002-02-14 17:14:34Z bears $
 */
 
 #if HAVE_CONFIG_H
@@ -132,7 +132,7 @@
     if ( ! Grp_local ( server.grp ) && ! Online_true() )
     {
         Fetchlist_read();
-        if ( ! Fetchlist_contains( server.grp ) )
+        if ( ! Fetchlist_contains( server.grp, NULL ) )
 	{
 	    if ( Cfg_autoSubscribe() )
 	    {
@@ -253,7 +253,19 @@
         return;
     if ( Fetch_init( Grp_server( grp ) ) )
     {
-        Fetch_getNewArts( grp, OVER );
+	FetchMode mode;
+
+	/*
+	 * See if group is on the fetchlist and if so use that mode.
+	 * That way we preserve the download semantics for groups on
+	 * the fetchlist. If the group is not on the fetchlist use
+	 * OVER to get just the overview info.
+	 */
+	Fetchlist_read();
+	if ( ! Fetchlist_contains( grp, &mode ) )
+	    mode = OVER;
+	
+        Fetch_getNewArts( grp, mode );
         Fetch_close();
     }
     else
@@ -281,7 +293,7 @@
 needsPseudoGenInfo( const char *grp )
 {
     return ! ( Grp_local( grp )
-	       || Fetchlist_contains( grp )
+	       || Fetchlist_contains( grp, NULL )
 	       || Online_true() );
 }