changeset 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 cb799054bd61
children 945501c95a4e
files ChangeLog src/post.c
diffstat 2 files changed, 20 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Thu Oct 26 22:29:55 2000 +0100
+++ b/ChangeLog	Thu Oct 26 22:55:49 2000 +0100
@@ -16,6 +16,12 @@
  * src/server.c: When replying to a command, generate the reply into
    a buffer, release the lock and then send the reply, so we don't
    hog the lock should the reply stall for some network reason.
+ * 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.
 
 Sun Oct 15 2000 Markus Enzenberger <markus.enzenberger@t-online.de>
 
--- 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 );
 	}