diff options
| author | fukachan <fukachan> | 2008-07-03 20:45:09 +0000 |
|---|---|---|
| committer | fukachan <fukachan> | 2008-07-03 20:45:09 +0000 |
| commit | f5983f8eca3143a17f0daee96538475cafaae99f (patch) | |
| tree | d313e3c29d201902253abed1b7d3bebd24b0c5f9 /fml/lib/FML | |
| parent | 1032b3028d97eefd77fb75159aa2e7d9889bac3a (diff) | |
| download | fml8-f5983f8eca3143a17f0daee96538475cafaae99f.tar.gz fml8-f5983f8eca3143a17f0daee96538475cafaae99f.tar.bz2 fml8-f5983f8eca3143a17f0daee96538475cafaae99f.zip | |
define hold() and discard()
Diffstat (limited to 'fml/lib/FML')
| -rw-r--r-- | fml/lib/FML/Restriction/Post.pm | 46 |
1 files changed, 45 insertions, 1 deletions
diff --git a/fml/lib/FML/Restriction/Post.pm b/fml/lib/FML/Restriction/Post.pm index 91283423..45a3cd35 100644 --- a/fml/lib/FML/Restriction/Post.pm +++ b/fml/lib/FML/Restriction/Post.pm @@ -4,7 +4,7 @@ # All rights reserved. This program is free software; you can # redistribute it and/or modify it under the same terms as Perl itself. # -# $FML: Post.pm,v 1.27 2006/05/09 12:30:05 fukachan Exp $ +# $FML: Post.pm,v 1.28 2008/06/28 20:06:21 fukachan Exp $ # package FML::Restriction::Post; @@ -187,15 +187,47 @@ sub reject } +=head1 EXTENSION: HOLD CASE + +=head2 hold() + +hold messages in the hold queue. + +=cut + + +# Descriptions: hold irrespective of other conditions. +# Arguments: OBJ($self) STR($rule) STR($sender) +# Side Effects: none +# Return Value: ARRAY(STR, STR) +sub hold +{ + my ($self, $rule, $sender) = @_; + my $curproc = $self->{ _curproc }; + + # XXX the deny reason is first match. + unless ($curproc->restriction_state_get_hold_reason()) { + $curproc->restriction_state_set_hold_reason($rule); + } + return("matched", "hold"); +} + + =head1 EXTENSION: IGNORE CASE =head2 ignore ignore irrespective of other conditions. +=head2 discard + +syntax sugar. +disard request, same as ignore() method. + =head2 ignore_invalid_request ignore request if the content is invalid. +same as ignore() in current implemention. =cut @@ -222,6 +254,18 @@ sub ignore # Arguments: OBJ($self) STR($rule) STR($sender) # Side Effects: none # Return Value: ARRAY(STR, STR) +sub discard +{ + my ($self, $rule, $sender) = @_; + $self->ignore(); +} + + +# Descriptions: ignore request if the content is invalid. +# same as ignore() in this module. +# Arguments: OBJ($self) STR($rule) STR($sender) +# Side Effects: none +# Return Value: ARRAY(STR, STR) sub ignore_invalid_request { my ($self, $rule, $sender) = @_; |
