From 55b0ef3002d2201b604bd53e2371a4deab0c5ecb Mon Sep 17 00:00:00 2001 From: David Bremner Date: Thu, 31 Jul 2008 09:20:16 -0300 Subject: [PATCH] factor out make_pair for debugging --- IkiWiki/Plugin/mailbox.pm | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/IkiWiki/Plugin/mailbox.pm b/IkiWiki/Plugin/mailbox.pm index 5f1c7d48e..c095f8baa 100644 --- a/IkiWiki/Plugin/mailbox.pm +++ b/IkiWiki/Plugin/mailbox.pm @@ -15,7 +15,6 @@ sub import { #{{{ hook(type => "preprocess", id => "mailbox", call => \&preprocess); } # }}} - sub preprocess (@) { #{{{ my %params=@_; @@ -47,6 +46,13 @@ sub format_mailbox(@){ } +sub make_pair($$){ + my $message=shift; + my $name=shift; + my $val=$message->header($_); + my $hash={'HEADERNAME'=>$name,'VAL'=>$val}; + return $hash; +} sub format_message(@){ my %params=@_; @@ -56,16 +62,14 @@ sub format_message(@){ my $template= template("email.tmpl") || error gettext("missing template"); - - my @headers=map { {'HEADERNAME'=>$_,'VAL'=>$message->header($_)} } - $message->header_names; + my @headers=map { make_pair($message,$_) } + $message->header_names; $template->param(HEADERS=>[@headers]); $template->param(body=>$message->body); my $output=$template->output(); - print STDERR $output; return $output; } -- 2.39.2