diff options
| author | fukachan <fukachan> | 2005-09-16 11:11:33 +0000 |
|---|---|---|
| committer | fukachan <fukachan> | 2005-09-16 11:11:33 +0000 |
| commit | 194cf5cdfe90f8e61ac659e8a9ada4571624b7f0 (patch) | |
| tree | a950330fb788dd98a529c7f04ef13e1f3e653605 /fml/lib | |
| parent | 4b35bb5e05f3b778bceaa8317bb5d37ef0c4306b (diff) | |
| download | fml8-194cf5cdfe90f8e61ac659e8a9ada4571624b7f0.tar.gz fml8-194cf5cdfe90f8e61ac659e8a9ada4571624b7f0.tar.bz2 fml8-194cf5cdfe90f8e61ac659e8a9ada4571624b7f0.zip | |
is_signature() and is_citation() switched to Mail::Message::String based.
Diffstat (limited to 'fml/lib')
| -rw-r--r-- | fml/lib/FML/Filter/TextPlain.pm | 42 |
1 files changed, 7 insertions, 35 deletions
diff --git a/fml/lib/FML/Filter/TextPlain.pm b/fml/lib/FML/Filter/TextPlain.pm index 1d0c48cc..2eb20edf 100644 --- a/fml/lib/FML/Filter/TextPlain.pm +++ b/fml/lib/FML/Filter/TextPlain.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: TextPlain.pm,v 1.14 2005/08/19 12:17:08 fukachan Exp $ +# $FML: TextPlain.pm,v 1.15 2005/08/27 14:49:33 fukachan Exp $ # package FML::Filter::TextPlain; @@ -426,17 +426,10 @@ sub need_one_line_check sub is_citation { my ($self, $data) = @_; - my $trap_pat = ''; # keyword to trap citation at the head of the line. - if ($data =~ /(\n.)/) { $trap_pat = quotemeta($1);} - - # XXX-TODO: only /\n>/ regexp is correct ? - # > a i u e o ... - # > ka ki ku ke ko ... - if ($data =~ /\n>/) { return 1;} - if ($trap_pat) { if ($data =~ /$trap_pat.*$trap_pat/) { return 1;}} - - return 0; + use Mail::Message::String; + my $str = new Mail::Message::String $data; + return $str->is_citation(); } @@ -451,30 +444,9 @@ sub is_signature { my ($self, $data) = @_; - if ($data =~ /\@/o || - $data =~ /TEL:/oi || - $data =~ /FAX:/oi || - $data =~ /:\/\//o ) { - return 1; - } - - # -- fukachan ( usenet style signature ? ) - # // fukachan ( signature derived from what ? ) - if ($data =~ /^--/o || $data =~ /^\/\//o) { - return 1; - } - - # XXX Japanese specific condition - use Mail::Message::Encode; - my $obj = new Mail::Message::Encode; - $data = $obj->convert( $data, 'euc-jp' ); - - # "2-byte @"domain where "@" is a 2-byte "@" character. - if ($data =~ /[-A-Za-z0-9]\241\367[-A-Za-z0-9]/o) { - return 1; - } - - return 0; + use Mail::Message::String; + my $str = new Mail::Message::String $data; + return $str->is_signature(); } |
