diff src/post.c @ 152:ca9769519c96 noffle

[svn] * src/post.c: When posting to a non-local moderated group, only post to one server. Don't want multiple upstream servers each mailing the moderator. Non-moderated groups post to all servers groups in the article are fetched from - otherwise can't be sure an article cross-posted to a netwide group and a restricted one obtained from a just one server will propagate properly.
author bears
date Thu, 26 Oct 2000 22:55:49 +0100
parents 1c7303c71f66
children 945501c95a4e
line wrap: on
line diff
--- a/src/post.c	Thu Oct 26 22:29:55 2000 +0100
+++ b/src/post.c	Thu Oct 26 22:55:49 2000 +0100
@@ -1,7 +1,7 @@
 /*
   post.c
 
-  $Id: post.c 227 2000-10-26 21:21:13Z bears $
+  $Id: post.c 229 2000-10-26 21:55:49Z bears $
 */
 
 #if HAVE_CONFIG_H
@@ -422,14 +422,14 @@
 {
     const char * grp;
     Str serversSeen;
-    Bool err;
+    Bool err, modPosted;
 
     /*
      * For each external group, send to that group's server if it has
      * not seen the post already.
      */
     serversSeen[ 0 ] = '\0';
-    err = FALSE;
+    err = modPosted = FALSE;
     
     for ( grp = Itl_first( article.newsgroups );
 	  grp != NULL;
@@ -438,15 +438,26 @@
 	if ( Grp_exists( grp ) && ! Grp_local( grp ) )
 	{
 	    const char * servName = Grp_server( grp );
+	    Bool moderated = ( Grp_postAllow( grp ) == 'm' );
 
 	    if ( strstr( serversSeen, servName ) != NULL )
 		continue;
+
+	    if ( moderated && modPosted )
+		continue;
 	    
 	    if ( ! Out_add( servName, article.over.msgId, article.text ) )
 	    {
 		Log_err( "Cannot add posted article to outgoing directory" );
 		err = TRUE;
 	    }
+	    /*
+	     * If moderated group, send to one server only. Don't want to
+	     * mailbomb the moderator.
+	     */
+	    else if ( moderated )
+		modPosted = TRUE;
+	    
 	    Utl_catStr( serversSeen, " " );
 	    Utl_catStr( serversSeen, servName );
 	}