summaryrefslogtreecommitdiff
path: root/fml
diff options
context:
space:
mode:
authorfukachan <fukachan>2001-12-18 12:56:05 +0000
committerfukachan <fukachan>2001-12-18 12:56:05 +0000
commit29d1b28720ef1d10db2d4ccc0d5142addb2b9dce (patch)
tree963757325877d7088633797c574f6588cefc4ec0 /fml
parent2f7d943439aa46e731cd2e458d49afbbd9c41301 (diff)
downloadfml8-29d1b28720ef1d10db2d4ccc0d5142addb2b9dce.tar.gz
fml8-29d1b28720ef1d10db2d4ccc0d5142addb2b9dce.tar.bz2
fml8-29d1b28720ef1d10db2d4ccc0d5142addb2b9dce.zip
htlmify article
Diffstat (limited to 'fml')
-rw-r--r--fml/lib/FML/Process/Distribute.pm37
1 files changed, 36 insertions, 1 deletions
diff --git a/fml/lib/FML/Process/Distribute.pm b/fml/lib/FML/Process/Distribute.pm
index c5361ac3..983ca62a 100644
--- a/fml/lib/FML/Process/Distribute.pm
+++ b/fml/lib/FML/Process/Distribute.pm
@@ -3,7 +3,7 @@
# Copyright (C) 2000,2001 Ken'ichi Fukamachi
# All rights reserved.
#
-# $FML: Distribute.pm,v 1.55 2001/11/26 09:12:37 fukachan Exp $
+# $FML: Distribute.pm,v 1.56 2001/11/27 11:40:30 fukachan Exp $
#
package FML::Process::Distribute;
@@ -212,6 +212,11 @@ sub _distribute
# delivery starts !
$curproc->_deliver_article($args);
+
+ if ($config->yes('use_html_archive')) {
+ Log("htmlify article $id");
+ $curproc->htmlify($args);
+ }
}
@@ -368,6 +373,36 @@ sub _thread_check
}
+sub htmlify
+{
+ my ($curproc, $args) = @_;
+ my $config = $curproc->{ config };
+ my $pcb = $curproc->{ pcb };
+ my $myname = $curproc->myname();
+
+ my $ml_name = $config->{ ml_name };
+ my $spool_dir = $config->{ spool_dir };
+ my $html_dir = $config->{ html_archive_dir };
+ my $article_id = $pcb->get('article', 'id');
+
+ use File::Spec;
+ my $article_file = File::Spec->catfile($spool_dir, $article_id);
+
+ eval q{
+ use Mail::HTML::Lite;
+ use File::Utils qw(mkdirhier);
+ };
+ unless ($@) {
+ mkdirhier($html_dir) unless -d $html_dir;
+ &Mail::HTML::Lite::htmlify_file($article_file, {
+ directory => $html_dir,
+ });
+ }
+ else {
+ Log($@) if $@;
+ }
+}
+
=head1 AUTHOR
Ken'ichi Fukamachi