summaryrefslogtreecommitdiff
path: root/fml/lib/FML/Command/SendFile.pm
diff options
context:
space:
mode:
authorfukachan <fukachan>2002-07-17 12:09:26 +0000
committerfukachan <fukachan>2002-07-17 12:09:26 +0000
commitfaeef4c81a194ce92a11e96456891698cb937fa3 (patch)
tree8ace7cbc4d82a37ad95f213270941c5806ea3d63 /fml/lib/FML/Command/SendFile.pm
parent819011b7696e4f152b608b75a32a362d362edd5e (diff)
downloadfml8-faeef4c81a194ce92a11e96456891698cb937fa3.tar.gz
fml8-faeef4c81a194ce92a11e96456891698cb937fa3.tar.bz2
fml8-faeef4c81a194ce92a11e96456891698cb937fa3.zip
use Mail::Message::MH
Diffstat (limited to 'fml/lib/FML/Command/SendFile.pm')
-rw-r--r--fml/lib/FML/Command/SendFile.pm51
1 files changed, 6 insertions, 45 deletions
diff --git a/fml/lib/FML/Command/SendFile.pm b/fml/lib/FML/Command/SendFile.pm
index c328653d..6381b475 100644
--- a/fml/lib/FML/Command/SendFile.pm
+++ b/fml/lib/FML/Command/SendFile.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: SendFile.pm,v 1.16 2002/04/08 12:44:24 fukachan Exp $
+# $FML: SendFile.pm,v 1.17 2002/07/02 12:05:49 fukachan Exp $
#
package FML::Command::SendFile;
@@ -118,51 +118,12 @@ sub _is_valid_argument
my $file = $config->{ sequence_file };
my $sequence = new File::Sequence { sequence_file => $file };
- if ($fn =~ /^\d+$/) {
- return [ $fn ];
- }
- elsif ($fn =~ /^[\d,]+$/) {
- my (@fn) = split(/,/, $fn);
- return \@fn;
- }
- elsif ($fn =~ /^(\d+)\-(\d+)$/) {
- my ($first, $last) = ($1, $2);
- return _expand_range($first, $last);
- }
- elsif ($fn eq 'first') {
- return [ 1 ];
- }
- elsif ($fn eq 'last' || $fn eq 'cur') {
- my $last_id = $sequence->get_id();
- return [ $last_id ];
- }
- elsif ($fn =~ /^first:(\d+)$/) {
- my $range = $1;
- return _expand_range(1, 1 + $range);
- }
- elsif ($fn =~ /^last:(\d+)$/) {
- my $range = $1;
- my $last_id = $sequence->get_id();
- return _expand_range($last_id - $range, $last_id);
- }
- else {
- return undef;
- }
-}
-
-
-# Descriptions: make an array from $fist to $last number.
-# This array is composed of article numbers.
-# Arguments: NUM($first_number) NUM($last_number)
-# Side Effects: none
-# Return Value: ARRAY_REF as [ $first .. $last ]
-sub _expand_range
-{
- my ($first, $last) = @_;
- my (@fn) = ();
+ use Mail::Message::MH;
+ my $mh = new Mail::Message::MH;
+ my $last_id = $sequence->get_id();
- for ($first .. $last) { push(@fn, $_);}
- return \@fn;
+ # XXX we assume min_id = 1, but not correct always.
+ return $mh->expand($fn, 1, $last_id);
}