summaryrefslogtreecommitdiff
path: root/fml/lib/FML/Process/ThreadTrack.pm
diff options
context:
space:
mode:
authorfukachan <fukachan>2001-11-07 03:14:22 +0000
committerfukachan <fukachan>2001-11-07 03:14:22 +0000
commit497120e54b4ba4186e96a31905e98fc70f495ae2 (patch)
tree41f4e85589c820a7aa3f12bcba2389db978a9668 /fml/lib/FML/Process/ThreadTrack.pm
parent01aa2418b66551a6385045d120315f8051253dfe (diff)
downloadfml8-497120e54b4ba4186e96a31905e98fc70f495ae2.tar.gz
fml8-497120e54b4ba4186e96a31905e98fc70f495ae2.tar.bz2
fml8-497120e54b4ba4186e96a31905e98fc70f495ae2.zip
fmlthread -f filterlist ...
Diffstat (limited to 'fml/lib/FML/Process/ThreadTrack.pm')
-rw-r--r--fml/lib/FML/Process/ThreadTrack.pm29
1 files changed, 28 insertions, 1 deletions
diff --git a/fml/lib/FML/Process/ThreadTrack.pm b/fml/lib/FML/Process/ThreadTrack.pm
index a2341122..48d5e392 100644
--- a/fml/lib/FML/Process/ThreadTrack.pm
+++ b/fml/lib/FML/Process/ThreadTrack.pm
@@ -4,7 +4,7 @@
# Copyright (C) 2000-2001 Ken'ichi Fukamachi
# All rights reserved.
#
-# $FML: ThreadTrack.pm,v 1.5 2001/11/05 14:35:48 fukachan Exp $
+# $FML: ThreadTrack.pm,v 1.6 2001/11/06 22:52:27 fukachan Exp $
#
package FML::Process::ThreadTrack;
@@ -75,6 +75,7 @@ sub run
my ($curproc, $args) = @_;
my $config = $curproc->{ config };
my $argv = $curproc->command_line_argv();
+ my $options = $curproc->command_line_options();
my $command = $argv->[ 0 ] || '';
# argumente for thread track module
@@ -94,6 +95,10 @@ sub run
my $thread = new Mail::ThreadTrack $ttargs;
$thread->set_mode('text');
+ if (defined $options->{ f }) {
+ _read_filter_list($thread, $options->{ f });
+ }
+
$curproc->lock();
if ($command eq 'list' || $command eq 'summary') {
@@ -128,6 +133,28 @@ sub run
}
+sub _read_filter_list
+{
+ my ($thread, $file) = @_;
+
+ if (-f $file) {
+ use FileHandle;
+ my $fh = new FileHandle $file;
+ if (defined $fh) {
+ my ($key, $value);
+ while (<$fh>) {
+ chop;
+ ($key, $value) = split(/\s+/, $_, 2);
+ if ($key) {
+ $thread->add_filter( { $key => $value });
+ }
+ }
+ $fh->close();
+ }
+ }
+}
+
+
# $thread_id accepts MH style format.
# MH style is expanded by C<Mail::Messsage::MH>.
sub _close