summaryrefslogtreecommitdiff
path: root/fml/lib
diff options
context:
space:
mode:
authorfukachan <fukachan>2003-07-20 06:51:02 +0000
committerfukachan <fukachan>2003-07-20 06:51:02 +0000
commitc084b40b5dbdbf49d349497b437894858abcd420 (patch)
tree038a62cd600c0ed8d3f83b17e842dd9e5a893ad1 /fml/lib
parentc8be2a505fc6308e00a47180118b0ed18d67171d (diff)
downloadfml8-c084b40b5dbdbf49d349497b437894858abcd420.tar.gz
fml8-c084b40b5dbdbf49d349497b437894858abcd420.tar.bz2
fml8-c084b40b5dbdbf49d349497b437894858abcd420.zip
separete thread_db_args() routine prepares thread information.
pass $aritcle_id to analyze().
Diffstat (limited to 'fml/lib')
-rw-r--r--fml/lib/FML/Process/Distribute.pm36
-rw-r--r--fml/lib/FML/Process/Utils.pm41
2 files changed, 58 insertions, 19 deletions
diff --git a/fml/lib/FML/Process/Distribute.pm b/fml/lib/FML/Process/Distribute.pm
index 8eec4cec..fbbf3a46 100644
--- a/fml/lib/FML/Process/Distribute.pm
+++ b/fml/lib/FML/Process/Distribute.pm
@@ -3,7 +3,7 @@
# Copyright (C) 2000,2001,2002,2003 Ken'ichi Fukamachi
# All rights reserved.
#
-# $FML: Distribute.pm,v 1.115 2003/05/13 04:26:48 fukachan Exp $
+# $FML: Distribute.pm,v 1.116 2003/07/19 12:58:49 fukachan Exp $
#
package FML::Process::Distribute;
@@ -539,13 +539,26 @@ sub _thread_check
my $msg = $curproc->article_message();
+ # old thread engine
eval q{
use Mail::ThreadTrack;
my $thread = new Mail::ThreadTrack $ttargs;
$thread->analyze($msg);
};
-
Log($@) if $@;
+
+ # new thread engine
+ {
+ use Mail::Message::Thread;
+
+ # XXX we need to specify article_id here since
+ # XXX analyzer routine has no clue for the curren primary key.
+ my $tdb_args = $curproc->thread_db_args($args);
+ $tdb_args->{ id } = $article_id;
+
+ my $thread = new Mail::Message::Thread $tdb_args;
+ $thread->analyze($msg);
+ }
}
@@ -567,20 +580,7 @@ sub htmlify
my $article_id = $pcb->get('article', 'id');
my $article_file = $article->filepath($article_id);
my $index_order = $config->{ html_archive_index_order_type };
- my $cur_lang = $curproc->language_of_html_file();
-
- unless (-d $udb_dir) { $curproc->mkdir($udb_dir);}
-
- # XXX-TODO: care for non Japanese.
- my $htmlifier_args = {
- charset => $cur_lang,
-
- output_dir => $html_dir, # ~fml/public_html/mlarchive/$domain/$ml/
- db_base_dir => $udb_dir, # /var/spool/ml/@udb@
- db_name => $ml_name, # elena
-
- index_order => $index_order, # normal/reverse
- };
+ my $_tdb_args = $curproc->thread_db_args($args);
$curproc->set_umask_as_public();
@@ -594,8 +594,8 @@ sub htmlify
}
eval q{
- my $obj = new Mail::Message::ToHTML $htmlifier_args;
- $obj->htmlify_file($article_file, $htmlifier_args);
+ my $obj = new Mail::Message::ToHTML $_tdb_args;
+ $obj->htmlify_file($article_file, $_tdb_args);
};
LogError($@) if $@;
}
diff --git a/fml/lib/FML/Process/Utils.pm b/fml/lib/FML/Process/Utils.pm
index 2071a0aa..e15d1be5 100644
--- a/fml/lib/FML/Process/Utils.pm
+++ b/fml/lib/FML/Process/Utils.pm
@@ -4,7 +4,7 @@
# All rights reserved. This program is free software; you can
# redistribute it and/or modify it under the same terms as Perl itself.
#
-# $FML: Utils.pm,v 1.67 2003/04/16 15:42:46 fukachan Exp $
+# $FML: Utils.pm,v 1.68 2003/05/01 13:14:54 fukachan Exp $
#
package FML::Process::Utils;
@@ -1238,6 +1238,45 @@ sub language_of_html_file
}
+=head2 thread_db_args($args)
+
+prepare and return information (HASH_REF) needed to manipulate thread
+database.
+
+=cut
+
+
+# Descriptions: return information (HASH_REF) needed for thread database.
+# Arguments: OBJ($curproc) HASH_REF($args)
+# Side Effects: none
+# Return Value: HASH_REF
+sub thread_db_args
+{
+ my ($curproc, $args) = @_;
+ my $config = $curproc->config();
+ my $ml_name = $config->{ ml_name };
+ my $html_dir = $config->{ html_archive_dir };
+ my $udb_dir = $config->{ udb_base_dir };
+ my $index_order = $config->{ html_archive_index_order_type };
+ my $cur_lang = $curproc->language_of_html_file();
+
+ unless (-d $udb_dir) { $curproc->mkdir($udb_dir);}
+
+ # XXX-TODO: care for non Japanese.
+ return {
+
+ charset => $cur_lang,
+
+ output_dir => $html_dir, # ~fml/public_html/mlarchive/$domain/$ml/
+ db_base_dir => $udb_dir, # /var/spool/ml/@udb@
+ db_name => $ml_name, # elena
+
+ index_order => $index_order, # normal/reverse
+
+ };
+}
+
+
=head2 hints()
return hints as HASH_REF.