line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
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::Message::Body::Delayed; |
10
|
28
|
|
|
28
|
|
10755
|
use vars '$VERSION'; |
|
28
|
|
|
|
|
236
|
|
|
28
|
|
|
|
|
1577
|
|
11
|
|
|
|
|
|
|
$VERSION = '3.009'; |
12
|
|
|
|
|
|
|
|
13
|
28
|
|
|
28
|
|
175
|
use base 'Mail::Reporter'; |
|
28
|
|
|
|
|
71
|
|
|
28
|
|
|
|
|
2572
|
|
14
|
|
|
|
|
|
|
|
15
|
28
|
|
|
28
|
|
219
|
use strict; |
|
28
|
|
|
|
|
63
|
|
|
28
|
|
|
|
|
695
|
|
16
|
28
|
|
|
28
|
|
249
|
use warnings; |
|
28
|
|
|
|
|
55
|
|
|
28
|
|
|
|
|
1254
|
|
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
use Object::Realize::Later |
19
|
28
|
|
|
|
|
203
|
becomes => 'Mail::Message::Body', |
20
|
|
|
|
|
|
|
realize => 'load', |
21
|
|
|
|
|
|
|
warn_realization => 0, |
22
|
28
|
|
|
28
|
|
13965
|
believe_caller => 1; |
|
28
|
|
|
|
|
33413
|
|
23
|
|
|
|
|
|
|
|
24
|
28
|
|
|
28
|
|
119214
|
use Carp; |
|
28
|
|
|
|
|
71
|
|
|
28
|
|
|
|
|
1553
|
|
25
|
28
|
|
|
28
|
|
191
|
use Scalar::Util 'weaken'; |
|
28
|
|
|
|
|
73
|
|
|
28
|
|
|
|
|
2392
|
|
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
use overload '""' => 'string_unless_carp' |
29
|
4256
|
|
|
4256
|
|
51444
|
, bool => sub {1} |
30
|
28
|
|
|
28
|
|
210
|
, '@{}' => sub {shift->load->lines}; |
|
28
|
|
|
2
|
|
61
|
|
|
28
|
|
|
|
|
285
|
|
|
2
|
|
|
|
|
761
|
|
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
#------------------------------------------ |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
sub init($) |
36
|
1484
|
|
|
1484
|
0
|
708933
|
{ my ($self, $args) = @_; |
37
|
1484
|
|
|
|
|
4244
|
$self->SUPER::init($args); |
38
|
|
|
|
|
|
|
|
39
|
1484
|
|
|
|
|
14376
|
$self->{MMB_seqnr} = -1; # for overloaded body comparison |
40
|
|
|
|
|
|
|
$self->{MMBD_message} = $args->{message} |
41
|
1484
|
50
|
|
|
|
4031
|
or $self->log(INTERNAL => "A message must be specified to a delayed body."); |
42
|
|
|
|
|
|
|
|
43
|
1484
|
|
|
|
|
4818
|
weaken($self->{MMBD_message}); |
44
|
1484
|
|
|
|
|
3988
|
$self; |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
#------------------------------------------ |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
|
50
|
1537
|
|
|
1537
|
1
|
18548
|
sub message() { shift->{MMBD_message} } |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
#------------------------------------------ |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
sub modified(;$) |
56
|
859
|
100
|
66
|
859
|
1
|
3032
|
{ return 0 if @_==1 || !$_[1]; |
57
|
1
|
|
|
|
|
42
|
shift->forceRealize(shift); |
58
|
|
|
|
|
|
|
} |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
sub isModified() {0} |
62
|
|
|
|
|
|
|
sub isDelayed() {1} |
63
|
1
|
|
|
1
|
1
|
6
|
sub isMultipart() {shift->message->head->isMultipart} |
64
|
135
|
|
|
135
|
1
|
47071
|
sub guessSize() {shift->{MMBD_size}} |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
sub nrLines() |
68
|
90
|
|
|
90
|
1
|
403
|
{ my ($self) = @_; |
69
|
|
|
|
|
|
|
defined $self->{MMBD_lines} |
70
|
|
|
|
|
|
|
? $self->{MMBD_lines} |
71
|
90
|
50
|
|
|
|
355
|
: $_[0]->forceRealize->nrLines; |
72
|
|
|
|
|
|
|
} |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
sub string_unless_carp() |
75
|
80
|
|
|
80
|
0
|
71399
|
{ my $self = shift; |
76
|
80
|
50
|
|
|
|
460
|
return $self->load->string if (caller)[0] ne 'Carp'; |
77
|
|
|
|
|
|
|
|
78
|
0
|
|
|
|
|
0
|
(my $class = ref $self) =~ s/^Mail::Message/MM/g; |
79
|
0
|
|
|
|
|
0
|
"$class object"; |
80
|
|
|
|
|
|
|
} |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
#------------------------------------------ |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
sub read($$;$@) |
86
|
747
|
|
|
747
|
1
|
38237
|
{ my ($self, $parser, $head, $bodytype) = splice @_, 0, 4; |
87
|
747
|
|
|
|
|
1573
|
$self->{MMBD_parser} = $parser; |
88
|
|
|
|
|
|
|
|
89
|
747
|
|
|
|
|
2498
|
@$self{ qw/MMBD_begin MMBD_end MMBD_size MMBD_lines/ } |
90
|
|
|
|
|
|
|
= $parser->bodyDelayed(@_); |
91
|
|
|
|
|
|
|
|
92
|
747
|
|
|
|
|
314965
|
$self; |
93
|
|
|
|
|
|
|
} |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
sub fileLocation(;@) { |
97
|
344
|
|
|
344
|
1
|
2502
|
my $self = shift; |
98
|
344
|
50
|
|
|
|
1498
|
return @$self{ qw/MMBD_begin MMBD_end/ } unless @_; |
99
|
0
|
|
|
|
|
0
|
@$self{ qw/MMBD_begin MMBD_end/ } = @_; |
100
|
|
|
|
|
|
|
} |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
sub moveLocation($) |
104
|
134
|
|
|
134
|
1
|
695
|
{ my ($self, $dist) = @_; |
105
|
134
|
|
|
|
|
238
|
$self->{MMBD_begin} -= $dist; |
106
|
134
|
|
|
|
|
211
|
$self->{MMBD_end} -= $dist; |
107
|
134
|
|
|
|
|
210
|
$self; |
108
|
|
|
|
|
|
|
} |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
|
111
|
176
|
|
|
176
|
1
|
10348
|
sub load() {$_[0] = $_[0]->message->loadBody} |
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
#------------------------------------------ |
114
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
1; |