From: David Bremner Date: Sun, 31 Aug 2008 17:01:59 +0000 (-0300) Subject: borrow some glue from ::attachment X-Git-Tag: 0.1~38 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=bc8abd9a00c98f9b2e48e2a3d6ff1c40c593a1ed;p=ikiwiki.git borrow some glue from ::attachment --- diff --git a/filters/postal-queue.pl b/filters/postal-queue.pl index 44d3b7700..ebd2627d5 100644 --- a/filters/postal-queue.pl +++ b/filters/postal-queue.pl @@ -1,6 +1,8 @@ #!/usr/bin/perl use Email::Folder; +use Email::LocalDelivery; + use Convert::YText qw(decode_ytext encode_ytext); # we need at least version 2.54 of IkiWiki for the new config api @@ -37,17 +39,30 @@ for my $messages ($folder->messages){ $msg_file= $comment_folder->write($message); - # update vcs + # update vcs, copied from Ikiwiki::Plugins::attachment - IkiWIki::rcs_add($msg_file); - + if ($config{rcs}) { + IkiWiki::rcs_add($filename); + IkiWiki::disable_commit_hook(); + IkiWiki::rcs_commit($filename, gettext("attachment upload"), + IkiWiki::rcs_prepedit($filename), + $session->param("name"), $ENV{REMOTE_ADDR}); + IkiWiki::enable_commit_hook(); + IkiWiki::rcs_update(); + } + # tag for deletion push (@must_die, $message->message-id); $folder->delete($message); - + } + + + # refresh wiki + IkiWiki::refresh(); + IkiWiki::saveindex(); # make regex for message-id