diff options
| author | fukachan <fukachan> | 2004-03-17 10:27:35 +0000 |
|---|---|---|
| committer | fukachan <fukachan> | 2004-03-17 10:27:35 +0000 |
| commit | 2fa203ff8d4b8709a4c51647c4991f74d7e5ee77 (patch) | |
| tree | 2c9c2efc54e8a7e9883f609f4c848626469753fa /fml/lib/FML/Process | |
| parent | fd2ffdf1599fdda3d91b9532329f12b7449c53fd (diff) | |
| download | fml8-2fa203ff8d4b8709a4c51647c4991f74d7e5ee77.tar.gz fml8-2fa203ff8d4b8709a4c51647c4991f74d7e5ee77.tar.bz2 fml8-2fa203ff8d4b8709a4c51647c4991f74d7e5ee77.zip | |
implement toggle of filter function by $use_article_filter
Diffstat (limited to 'fml/lib/FML/Process')
| -rw-r--r-- | fml/lib/FML/Process/Distribute.pm | 55 |
1 files changed, 30 insertions, 25 deletions
diff --git a/fml/lib/FML/Process/Distribute.pm b/fml/lib/FML/Process/Distribute.pm index 51aa18d8..f41fe660 100644 --- a/fml/lib/FML/Process/Distribute.pm +++ b/fml/lib/FML/Process/Distribute.pm @@ -3,7 +3,7 @@ # Copyright (C) 2000,2001,2002,2003,2004 Ken'ichi Fukamachi # All rights reserved. # -# $FML: Distribute.pm,v 1.138 2004/03/12 11:45:51 fukachan Exp $ +# $FML: Distribute.pm,v 1.139 2004/03/14 06:45:02 fukachan Exp $ # package FML::Process::Distribute; @@ -145,31 +145,36 @@ sub _check_filter my ($curproc) = @_; my $config = $curproc->config(); - eval q{ - use FML::Filter; - my $filter = new FML::Filter; - my $r = $filter->article_filter($curproc); - - # filter traps this message. - if ($r = $filter->error()) { - if ($config->yes('use_article_filter_reject_notice')) { - my $msg_args = { - _arg_reason => $r, - }; - - $curproc->log("(debug) filter: inform rejection"); - $filter->article_filter_reject_notice($curproc, $msg_args); - } - else { - $curproc->log("filter: not inform rejection"); + if ($config->yes('use_article_filter')) { + eval q{ + use FML::Filter; + my $filter = new FML::Filter; + my $r = $filter->article_filter($curproc); + + # filter traps this message. + if ($r = $filter->error()) { + if ($config->yes('use_article_filter_reject_notice')) { + my $msg_args = { + _arg_reason => $r, + }; + + $curproc->log("(debug) filter: inform rejection"); + $filter->article_filter_reject_notice($curproc, $msg_args); + } + else { + $curproc->log("filter: not inform rejection"); + } + + # we should stop this process ASAP. + $curproc->stop_this_process(); + $curproc->log("rejected by filter due to $r"); } - - # we should stop this process ASAP. - $curproc->stop_this_process(); - $curproc->log("rejected by filter due to $r"); - } - }; - $curproc->log($@) if $@; + }; + $curproc->log($@) if $@; + } + else { + $curproc->log("debug: article_filter disabled"); + } } |
