comparison src/post.c @ 153:945501c95a4e noffle

[svn] Undo change to post.c that only sent moderated articles to one server. Suppose you have a cross-posted article that goes to a moderated general group (via the usual server) *and* a moderated special-purpose group via a special server that doesn't talk to the rest of the world. Send only to one and something will get lost.
author bears
date Fri, 27 Oct 2000 13:35:51 +0100
parents ca9769519c96
children f973675760dc
comparison
equal deleted inserted replaced
152:ca9769519c96 153:945501c95a4e
1 /* 1 /*
2 post.c 2 post.c
3 3
4 $Id: post.c 229 2000-10-26 21:55:49Z bears $ 4 $Id: post.c 230 2000-10-27 12:35:51Z bears $
5 */ 5 */
6 6
7 #if HAVE_CONFIG_H 7 #if HAVE_CONFIG_H
8 #include <config.h> 8 #include <config.h>
9 #endif 9 #endif
420 static Bool 420 static Bool
421 postExternal( void ) 421 postExternal( void )
422 { 422 {
423 const char * grp; 423 const char * grp;
424 Str serversSeen; 424 Str serversSeen;
425 Bool err, modPosted; 425 Bool err;
426 426
427 /* 427 /*
428 * For each external group, send to that group's server if it has 428 * For each external group, send to that group's server if it has
429 * not seen the post already. 429 * not seen the post already.
430 */ 430 */
431 serversSeen[ 0 ] = '\0'; 431 serversSeen[ 0 ] = '\0';
432 err = modPosted = FALSE; 432 err = FALSE;
433 433
434 for ( grp = Itl_first( article.newsgroups ); 434 for ( grp = Itl_first( article.newsgroups );
435 grp != NULL; 435 grp != NULL;
436 grp = Itl_next( article.newsgroups ) ) 436 grp = Itl_next( article.newsgroups ) )
437 { 437 {
438 if ( Grp_exists( grp ) && ! Grp_local( grp ) ) 438 if ( Grp_exists( grp ) && ! Grp_local( grp ) )
439 { 439 {
440 const char * servName = Grp_server( grp ); 440 const char * servName = Grp_server( grp );
441 Bool moderated = ( Grp_postAllow( grp ) == 'm' );
442 441
443 if ( strstr( serversSeen, servName ) != NULL ) 442 if ( strstr( serversSeen, servName ) != NULL )
444 continue; 443 continue;
445 444
446 if ( moderated && modPosted )
447 continue;
448
449 if ( ! Out_add( servName, article.over.msgId, article.text ) ) 445 if ( ! Out_add( servName, article.over.msgId, article.text ) )
450 { 446 {
451 Log_err( "Cannot add posted article to outgoing directory" ); 447 Log_err( "Cannot add posted article to outgoing directory" );
452 err = TRUE; 448 err = TRUE;
453 } 449 }
454 /*
455 * If moderated group, send to one server only. Don't want to
456 * mailbomb the moderator.
457 */
458 else if ( moderated )
459 modPosted = TRUE;
460 450
461 Utl_catStr( serversSeen, " " ); 451 Utl_catStr( serversSeen, " " );
462 Utl_catStr( serversSeen, servName ); 452 Utl_catStr( serversSeen, servName );
463 } 453 }
464 } 454 }