diff options
| author | fukachan <fukachan> | 2001-02-12 13:50:25 +0000 |
|---|---|---|
| committer | fukachan <fukachan> | 2001-02-12 13:50:25 +0000 |
| commit | 67a0689ce8f8347cf6bfd04fb8e7fd492f899a0a (patch) | |
| tree | 7d0adc9021bd2b817d7435f24bd9568508cc2925 | |
| parent | 761844e0279ee614f709d3df8135f3c3e5afc5ff (diff) | |
| download | fml8-67a0689ce8f8347cf6bfd04fb8e7fd492f899a0a.tar.gz fml8-67a0689ce8f8347cf6bfd04fb8e7fd492f899a0a.tar.bz2 fml8-67a0689ce8f8347cf6bfd04fb8e7fd492f899a0a.zip | |
get_first_plaintext_message() returns message object not content string
| -rw-r--r-- | fml/lib/FML/Ticket/Model/toymodel.pm | 3 | ||||
| -rw-r--r-- | fml/lib/MailingList/Messages.pm | 13 |
2 files changed, 10 insertions, 6 deletions
diff --git a/fml/lib/FML/Ticket/Model/toymodel.pm b/fml/lib/FML/Ticket/Model/toymodel.pm index 748a84c8..51642010 100644 --- a/fml/lib/FML/Ticket/Model/toymodel.pm +++ b/fml/lib/FML/Ticket/Model/toymodel.pm @@ -143,7 +143,8 @@ sub update_status # entries to check my $subject = $header->get('subject'); - my $content = $body->get_first_plaintext_message(); + my $message = $body->get_first_plaintext_message(); + my $content = $message->get_content_body(); my $pragma = $header->get('x-ticket-pragma') || ''; if ($content =~ /^\s*close/ || diff --git a/fml/lib/MailingList/Messages.pm b/fml/lib/MailingList/Messages.pm index 9ea2b331..559ef100 100644 --- a/fml/lib/MailingList/Messages.pm +++ b/fml/lib/MailingList/Messages.pm @@ -785,7 +785,13 @@ which is the whole mail or a part of multipart. =head2 C<get_first_plaintext_message($args)> -return the content for the first "plain/text" message in a chain. +return the Messages object for the first "plain/text" message in a +chain. For example, + + $m = $msg->get_first_plaintext_message(); + $body = $m->get_content_body(); + +where $body is the mail body (string). =cut @@ -827,11 +833,8 @@ sub get_content_body sub get_first_plaintext_message { my ($self, $args) = @_; - my $size = $args->{ size } || 512; - # use Data::Dumper; print STDERR Dumper( $self ), "\n"; - my $mp; for ($mp = $self; defined $mp->{ content } || defined $mp->{ next }; @@ -839,7 +842,7 @@ sub get_first_plaintext_message my $type = $mp->get_content_type; if ($type eq 'text/plain') { - return $mp->get_content_body($size); + return $mp; } } |
