develooper Front page | perl.pep | Postings from January 2011

[PATCH] Make Email::Filter pass the @boxes argument to its triggers

From:
Stefan Kangas
Date:
January 31, 2011 01:49
Subject:
[PATCH] Make Email::Filter pass the @boxes argument to its triggers
Message ID:
87aaihsrdc.fsf@skangas.se
diff -Naur Email-Filter-1.032/lib/Email/Filter.pm Email-Filter-1.032-skangas//lib/Email/Filter.pm
--- Email-Filter-1.032/lib/Email/Filter.pm	2008-09-15 05:26:26.000000000 +0200
+++ Email-Filter-1.032-skangas//lib/Email/Filter.pm	2011-01-31 03:19:20.000000000 +0100
@@ -266,11 +266,11 @@
 
 sub accept {
     my ($self, @boxes) = @_;
-    $self->call_trigger("before_accept");
+    $self->call_trigger("before_accept", \@boxes);
     # Unparsing and reparsing is so fast we prefer to do that in order
     # to keep to LocalDelivery's clean interface.
     if (Email::LocalDelivery->deliver($self->simple->as_string, @boxes)) {
-        $self->call_trigger("after_accept");
+        $self->call_trigger("after_accept", \@boxes);
         $self->done_ok;
     } else {
         $self->fail_gracefully();
@@ -322,7 +322,7 @@
     my ($self, @program) = @_;
     my $stdout;
     my $string = $self->simple->as_string;
-    $self->call_trigger("pipe");
+    $self->call_trigger("pipe", \@program);
     if (eval {run(\@program, \$string, \$stdout)} ) {
         $self->done_ok;
         return $stdout;



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About