summaryrefslogtreecommitdiff
path: root/fml/lib/FML/Process
diff options
context:
space:
mode:
authorfukachan <fukachan>2008-07-06 05:31:47 +0000
committerfukachan <fukachan>2008-07-06 05:31:47 +0000
commit967cb222ffd658dd9d5ce340b06026200960d7c9 (patch)
tree1f99521e90d5621d65ec23a4ad81b773a9ce3c22 /fml/lib/FML/Process
parent781354189b9da6def424bf1392009f5144d003e6 (diff)
downloadfml8-967cb222ffd658dd9d5ce340b06026200960d7c9.tar.gz
fml8-967cb222ffd658dd9d5ce340b06026200960d7c9.tar.bz2
fml8-967cb222ffd658dd9d5ce340b06026200960d7c9.zip
define "isolate" operation template.
"isolate" differs "hold". "isolate" sets apart spam candidates from normal incoming messages, whereas "hold" moves the incoming message to "hold" queue, which does not move until someone changes the state.
Diffstat (limited to 'fml/lib/FML/Process')
-rw-r--r--fml/lib/FML/Process/Distribute.pm14
-rw-r--r--fml/lib/FML/Process/State.pm31
2 files changed, 42 insertions, 3 deletions
diff --git a/fml/lib/FML/Process/Distribute.pm b/fml/lib/FML/Process/Distribute.pm
index 0deec9a2..c97c7aa1 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,2005,2006 Ken'ichi Fukamachi
# All rights reserved.
#
-# $FML: Distribute.pm,v 1.178 2006/05/04 05:19:37 fukachan Exp $
+# $FML: Distribute.pm,v 1.179 2006/07/09 12:11:13 fukachan Exp $
#
package FML::Process::Distribute;
@@ -259,7 +259,17 @@ sub run
$curproc->log("ignore article submission");
$curproc->stop_this_process();
}
- else {
+ elsif ($action eq 'hold') {
+ # XXX NEED actual hold operation !
+ $curproc->log("ignore and hold article");
+ $curproc->stop_this_process();
+ }
+ elsif ($action eq 'isolate') {
+ # XXX NEED actual isolate operation !
+ $curproc->log("isolate article");
+ $curproc->stop_this_process();
+ }
+ else { # reject and anything.
$curproc->logerror("deny article submission");
$curproc->stop_this_process();
diff --git a/fml/lib/FML/Process/State.pm b/fml/lib/FML/Process/State.pm
index cbb02cc3..430df6a6 100644
--- a/fml/lib/FML/Process/State.pm
+++ b/fml/lib/FML/Process/State.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: State.pm,v 1.27 2008/07/03 20:44:12 fukachan Exp $
+# $FML: State.pm,v 1.28 2008/07/03 20:49:57 fukachan Exp $
#
package FML::Process::State;
@@ -170,6 +170,35 @@ sub restriction_state_get_hold_reason
}
+# Descriptions: save reason on isolate.
+# Arguments: OBJ($curproc) STR($reason)
+# Side Effects: none
+# Return Value: none
+sub restriction_state_set_isolate_reason
+{
+ my ($curproc, $reason) = @_;
+ my $pcb = $curproc->pcb();
+ $pcb->set("check_restrictions", "isolate_reason", $reason);
+
+ if ($debug) {
+ $curproc->logdebug("restriction_state_set_isolate_reason: $reason");
+ }
+}
+
+
+# Descriptions: return the latest reason on isolate.
+# Arguments: OBJ($curproc)
+# Side Effects: none
+# Return Value: none
+sub restriction_state_get_isolate_reason
+{
+ my ($curproc) = @_;
+ my $pcb = $curproc->pcb();
+
+ return $pcb->get("check_restrictions", "isolate_reason");
+}
+
+
# Descriptions: send message on the latest reason on denial.
# Arguments: OBJ($curproc) STR($type) HASH_REF($msg_args)
# Side Effects: none