| 1 | # Copyrights 2001-2020 by [Mark Overmeer]. | ||||||||||
| 2 | # For other contributors see ChangeLog. | ||||||||||
| 3 | # See the manual pages for details on the licensing terms. | ||||||||||
| 4 | # Pod stripped from pm file by OODoc 2.02. | ||||||||||
| 5 | # This code is part of distribution Mail-Box. Meta-POD processed with | ||||||||||
| 6 | # OODoc into POD and HTML manual-pages. See README.md | ||||||||||
| 7 | # Copyright Mark Overmeer. Licensed under the same terms as Perl itself. | ||||||||||
| 8 | |||||||||||
| 9 | package Mail::Box::Net::Message; | ||||||||||
| 10 | 1 | ▶ | use vars '$VERSION'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 11 | 1 | $VERSION = '3.009'; | |||||||||
| 12 | |||||||||||
| 13 | 1 | ▶ | use base 'Mail::Box::Message'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 14 | |||||||||||
| 15 | 1 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 16 | 1 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 17 | |||||||||||
| 18 | 1 | ▶ | use File::Copy; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 19 | 1 | ▶ | use Carp; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 20 | |||||||||||
| 21 | |||||||||||
| 22 | sub init($) | ||||||||||
| 23 | 0 | ▶ | { my ($self, $args) = @_; | ||||||||
|
Subroutine
init: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 24 | |||||||||||
| 25 | 0 | $self->SUPER::init($args); | |||||||||
| 26 | |||||||||||
| 27 | 0 | $self->unique($args->{unique}); | |||||||||
| 28 | 0 | $self; | |||||||||
| 29 | } | ||||||||||
| 30 | |||||||||||
| 31 | #------------------------------------------- | ||||||||||
| 32 | |||||||||||
| 33 | |||||||||||
| 34 | sub unique(;$) | ||||||||||
| 35 | 0 | ▶ | { my $self = shift; | ||||||||
|
Subroutine
unique: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||
| 36 | 0 | ▶ | @_ ? $self->{MBNM_unique} = shift : $self->{MBNM_unique}; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 37 | } | ||||||||||
| 38 | |||||||||||
| 39 | #------------------------------------------- | ||||||||||
| 40 | |||||||||||
| 41 | |||||||||||
| 42 | #------------------------------------------- | ||||||||||
| 43 | |||||||||||
| 44 | sub loadHead() | ||||||||||
| 45 | 0 | ▶ | { my $self = shift; | ||||||||
|
Subroutine
loadHead: not called CC=3 SCAR=24.8
Pod
undocumented
| |||||||||||
| 46 | 0 | my $head = $self->head; | |||||||||
| 47 | 0 | ▶ | return $head unless $head->isDelayed; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 48 | |||||||||||
| 49 | 0 | my $folder = $self->folder; | |||||||||
| 50 | 0 | $folder->lazyPermitted(1); | |||||||||
| 51 | |||||||||||
| 52 | 0 | ▶ | my $parser = $self->parser or return; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 53 | 0 | $self->readFromParser($parser); | |||||||||
| 54 | |||||||||||
| 55 | 0 | $folder->lazyPermitted(0); | |||||||||
| 56 | |||||||||||
| 57 | 0 | $self->log(PROGRESS => 'Loaded delayed head.'); | |||||||||
| 58 | 0 | $self->head; | |||||||||
| 59 | } | ||||||||||
| 60 | |||||||||||
| 61 | #------------------------------------------- | ||||||||||
| 62 | |||||||||||
| 63 | |||||||||||
| 64 | sub loadBody() | ||||||||||
| 65 | 0 | ▶ | { my $self = shift; | ||||||||
|
Subroutine
loadBody: not called CC=6 SCAR=37.4
Pod
documented
| |||||||||||
| 66 | |||||||||||
| 67 | 0 | my $body = $self->body; | |||||||||
| 68 | 0 | ▶ | return $body unless $body->isDelayed; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 69 | |||||||||||
| 70 | 0 | my $head = $self->head; | |||||||||
| 71 | 0 | ▶ | my $parser = $self->parser or return; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 72 | |||||||||||
| 73 | 0 | ▶ | if($head->isDelayed) | ||||||||
|
Branch: 1 branch
| |||||||||||
| 74 | 0 | { $head = $self->readHead($parser); | |||||||||
| 75 | 0 | ▶ | if(defined $head) | ||||||||
|
Branch: 1 branch
| |||||||||||
| 76 | 0 | { $self->log(PROGRESS => 'Loaded delayed head.'); | |||||||||
| 77 | 0 | $self->head($head); | |||||||||
| 78 | } | ||||||||||
| 79 | else | ||||||||||
| 80 | 0 | { $self->log(ERROR => 'Unable to read delayed head.'); | |||||||||
| 81 | 0 | return; | |||||||||
| 82 | } | ||||||||||
| 83 | } | ||||||||||
| 84 | else | ||||||||||
| 85 | 0 | { my ($begin, $end) = $body->fileLocation; | |||||||||
| 86 | 0 | $parser->filePosition($begin); | |||||||||
| 87 | } | ||||||||||
| 88 | |||||||||||
| 89 | 0 | my $newbody = $self->readBody($parser, $head); | |||||||||
| 90 | 0 | ▶ | unless(defined $newbody) | ||||||||
|
Branch: 1 branch
| |||||||||||
| 91 | 0 | { $self->log(ERROR => 'Unable to read delayed body.'); | |||||||||
| 92 | 0 | return; | |||||||||
| 93 | } | ||||||||||
| 94 | |||||||||||
| 95 | 0 | $self->log(PROGRESS => 'Loaded delayed body.'); | |||||||||
| 96 | 0 | $self->storeBody($newbody->contentInfoFrom($head)); | |||||||||
| 97 | } | ||||||||||
| 98 | |||||||||||
| 99 | #------------------------------------------- | ||||||||||
| 100 | |||||||||||
| 101 | 1 | 1; | |||||||||