diff options
author | dakkar <dakkar@thenautilus.net> | 2016-10-21 18:20:37 +0100 |
---|---|---|
committer | dakkar <dakkar@thenautilus.net> | 2016-10-21 18:25:44 +0100 |
commit | 9af2e4e35f1285f50d25f96066bdec0a0c0788e2 (patch) | |
tree | 83b72b88282d4a5cf6ab2669f90bb0b5cc193788 /lib/Sietima.pm | |
parent | FS mailstore & tests (diff) | |
download | Sietima-9af2e4e35f1285f50d25f96066bdec0a0c0788e2.tar.gz Sietima-9af2e4e35f1285f50d25f96066bdec0a0c0788e2.tar.bz2 Sietima-9af2e4e35f1285f50d25f96066bdec0a0c0788e2.zip |
use more signatures
as long as you don't need coercions, Type::Params and sub signatures can
be used together
Diffstat (limited to 'lib/Sietima.pm')
-rw-r--r-- | lib/Sietima.pm | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/lib/Sietima.pm b/lib/Sietima.pm index 6a7a83e..df5de4e 100644 --- a/lib/Sietima.pm +++ b/lib/Sietima.pm @@ -49,9 +49,8 @@ has transport => ( ); sub _build_transport { Email::Sender::Simple->default_transport } -sub handle_mail { - state $check = compile(Object,EmailMIME); - my ($self,$incoming_mail) = $check->(@_); +sub handle_mail($self,$incoming_mail) { + state $check = compile(Object,EmailMIME); $check->(@_); my (@outgoing_messages) = $self->munge_mail($incoming_mail); for my $outgoing_message (@outgoing_messages) { @@ -60,16 +59,14 @@ sub handle_mail { return; } -sub subscribers_to_send_to { - state $check = compile(Object,EmailMIME); - my ($self,$incoming_mail) = $check->(@_); +sub subscribers_to_send_to($self,$incoming_mail) { + state $check = compile(Object,EmailMIME); $check->(@_); return $self->subscribers; } -sub munge_mail { - state $check = compile(Object,EmailMIME); - my ($self,$incoming_mail) = $check->(@_); +sub munge_mail($self,$incoming_mail) { + state $check = compile(Object,EmailMIME); $check->(@_); return Sietima::Message->new({ mail => $incoming_mail, @@ -78,9 +75,8 @@ sub munge_mail { }); } -sub send_message { - state $check = compile(Object,Message); - my ($self,$outgoing_message) = $check->(@_); +sub send_message($self,$outgoing_message) { + state $check = compile(Object,Message); $check->(@_); my $envelope = $outgoing_message->envelope; if ($envelope->{to} && $envelope->{to}->@*) { |