summaryrefslogtreecommitdiff
path: root/fml/lib/Mail/ThreadTrack
diff options
context:
space:
mode:
authorfukachan <fukachan>2001-11-20 07:29:27 +0000
committerfukachan <fukachan>2001-11-20 07:29:27 +0000
commit96758a7488827dc2de544d4f77093a6e2ae11f95 (patch)
treed30a699af24c7c2bb84ec71b18c16a56aa8926a0 /fml/lib/Mail/ThreadTrack
parent26b18b5429cb8408c214e2656446517fd82bb821 (diff)
downloadfml8-96758a7488827dc2de544d4f77093a6e2ae11f95.tar.gz
fml8-96758a7488827dc2de544d4f77093a6e2ae11f95.tar.bz2
fml8-96758a7488827dc2de544d4f77093a6e2ae11f95.zip
validate variables
Diffstat (limited to 'fml/lib/Mail/ThreadTrack')
-rw-r--r--fml/lib/Mail/ThreadTrack/HeaderRewrite.pm50
1 files changed, 26 insertions, 24 deletions
diff --git a/fml/lib/Mail/ThreadTrack/HeaderRewrite.pm b/fml/lib/Mail/ThreadTrack/HeaderRewrite.pm
index 5d08eaeb..2091df47 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.5 2001/11/03 11:58:45 fukachan Exp $
+# $FML: HeaderRewrite.pm,v 1.6 2001/11/10 13:20:56 fukachan Exp $
#
package Mail::ThreadTrack::HeaderRewrite;
@@ -50,31 +50,33 @@ sub rewrite_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 };
+ 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 });
- }
-
- if (defined $self->{ _thread_id }) {
- $header->add('X-Thread-ID', $self->{ _thread_id });
- }
-
- if (defined $self->{ _status_history }) {
- $header->add('X-Thread-History', $self->{ _status_history });
+ if (defined $header->get('subject')) {
+ my $subject = $header->get('subject');
+
+ if ($loctype eq 'appended' && $tag) {
+ $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 });
+ }
+
+ if (defined $self->{ _thread_id }) {
+ $header->add('X-Thread-ID', $self->{ _thread_id });
+ }
+
+ if (defined $self->{ _status_history }) {
+ $header->add('X-Thread-History', $self->{ _status_history });
+ }
}
}