diff options
| author | fukachan <fukachan> | 2001-11-03 11:58:45 +0000 |
|---|---|---|
| committer | fukachan <fukachan> | 2001-11-03 11:58:45 +0000 |
| commit | d628a05b6d81a4a0a5eb8521ba2afb8398b18704 (patch) | |
| tree | 708b47f176317a4d0eb9eea0efc0079c4da0fc61 /fml/lib/Mail/ThreadTrack | |
| parent | 3d8b9dc0ef91d409ac849365ef5e1f12b9ee58cd (diff) | |
| download | fml8-d628a05b6d81a4a0a5eb8521ba2afb8398b18704.tar.gz fml8-d628a05b6d81a4a0a5eb8521ba2afb8398b18704.tar.bz2 fml8-d628a05b6d81a4a0a5eb8521ba2afb8398b18704.zip | |
merge rewrite_header() function to HeaderRewrite.pm
Diffstat (limited to 'fml/lib/Mail/ThreadTrack')
| -rw-r--r-- | fml/lib/Mail/ThreadTrack/Analyze.pm | 34 | ||||
| -rw-r--r-- | fml/lib/Mail/ThreadTrack/HeaderRewrite.pm | 29 |
2 files changed, 28 insertions, 35 deletions
diff --git a/fml/lib/Mail/ThreadTrack/Analyze.pm b/fml/lib/Mail/ThreadTrack/Analyze.pm index 5d92103f..42abf4f8 100644 --- a/fml/lib/Mail/ThreadTrack/Analyze.pm +++ b/fml/lib/Mail/ThreadTrack/Analyze.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: Analyze.pm,v 1.6 2001/11/03 07:47:31 fukachan Exp $ +# $FML: Analyze.pm,v 1.7 2001/11/03 08:50:38 fukachan Exp $ # package Mail::ThreadTrack::Analyze; @@ -436,38 +436,6 @@ sub _create_thread_id_strings } -=head2 rewrite_header($msg) - -=cut - - -# Descriptions: -# Arguments: $self $msg -# Side Effects: -# Return Value: none -sub rewrite_header -{ - my ($self, $msg) = @_; - my $config = $self->{ _config }; - my $loctype = $config->{ thread_subject_tag_location } || 'appended'; - my $header = $msg->rfc822_message_header(); - my $tag = $self->{ _thread_subject_tag }; - - # append the thread tag to the subject - my $subject = $header->get('subject') || ''; - - if ($loctype eq 'appended') { - $header->replace('subject', $subject ." ". $tag); - } - elsif ($loctype eq 'prepended') { - $header->replace('subject', $tag ." ". $subject); - } - else { - $self->log("unknown thread_subject_tag_location type"); - } -} - - =head2 update_db($msg) =cut diff --git a/fml/lib/Mail/ThreadTrack/HeaderRewrite.pm b/fml/lib/Mail/ThreadTrack/HeaderRewrite.pm index 7d5afe91..5cb3270e 100644 --- a/fml/lib/Mail/ThreadTrack/HeaderRewrite.pm +++ b/fml/lib/Mail/ThreadTrack/HeaderRewrite.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: HeaderRewrite.pm,v 1.3 2001/11/03 01:22:14 fukachan Exp $ +# $FML: HeaderRewrite.pm,v 1.4 2001/11/03 07:42:08 fukachan Exp $ # package Mail::ThreadTrack::HeaderRewrite; @@ -35,10 +35,35 @@ C<$msg> is Mail::Message object. # Arguments: $self $args # Side Effects: # Return Value: none +=head2 rewrite_header($msg) + +=cut + + +# Descriptions: +# Arguments: $self $msg +# Side Effects: +# Return Value: none sub rewrite_header { my ($self, $msg) = @_; - my $header = $msg->rfc822_message_header; + my $config = $self->{ _config }; + my $loctype = $config->{ thread_subject_tag_location } || 'appended'; + my $header = $msg->rfc822_message_header(); + my $tag = $self->{ _thread_subject_tag }; + + # append the thread tag to the subject + my $subject = $header->get('subject') || ''; + + if ($loctype eq 'appended') { + $header->replace('subject', $subject ." ". $tag); + } + elsif ($loctype eq 'prepended') { + $header->replace('subject', $tag ." ". $subject); + } + else { + $self->log("unknown thread_subject_tag_location type"); + } if (defined $self->{ _status_info }) { $header->add('X-Thread-Status', $self->{ _status_info }); |
