line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# Copyrights 2001-2019 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
|
|
9288
|
use vars '$VERSION'; |
|
28
|
|
|
|
|
155
|
|
|
28
|
|
|
|
|
1212
|
|
11
|
|
|
|
|
|
|
$VERSION = '3.008'; |
12
|
|
|
|
|
|
|
|
13
|
28
|
|
|
28
|
|
136
|
use base 'Mail::Reporter'; |
|
28
|
|
|
|
|
65
|
|
|
28
|
|
|
|
|
2123
|
|
14
|
|
|
|
|
|
|
|
15
|
28
|
|
|
28
|
|
141
|
use strict; |
|
28
|
|
|
|
|
50
|
|
|
28
|
|
|
|
|
676
|
|
16
|
28
|
|
|
28
|
|
146
|
use warnings; |
|
28
|
|
|
|
|
41
|
|
|
28
|
|
|
|
|
1185
|
|
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
use Object::Realize::Later |
19
|
28
|
|
|
|
|
160
|
becomes => 'Mail::Message::Body', |
20
|
|
|
|
|
|
|
realize => 'load', |
21
|
|
|
|
|
|
|
warn_realization => 0, |
22
|
28
|
|
|
28
|
|
11077
|
believe_caller => 1; |
|
28
|
|
|
|
|
28047
|
|
23
|
|
|
|
|
|
|
|
24
|
28
|
|
|
28
|
|
119592
|
use Carp; |
|
28
|
|
|
|
|
50
|
|
|
28
|
|
|
|
|
1241
|
|
25
|
28
|
|
|
28
|
|
141
|
use Scalar::Util 'weaken'; |
|
28
|
|
|
|
|
51
|
|
|
28
|
|
|
|
|
1983
|
|
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
use overload '""' => 'string_unless_carp' |
29
|
4256
|
|
|
4256
|
|
42316
|
, bool => sub {1} |
30
|
28
|
|
|
28
|
|
163
|
, '@{}' => sub {shift->load->lines}; |
|
28
|
|
|
2
|
|
48
|
|
|
28
|
|
|
|
|
256
|
|
|
2
|
|
|
|
|
615
|
|
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
#------------------------------------------ |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
sub init($) |
36
|
1484
|
|
|
1484
|
0
|
577870
|
{ my ($self, $args) = @_; |
37
|
1484
|
|
|
|
|
3643
|
$self->SUPER::init($args); |
38
|
|
|
|
|
|
|
|
39
|
1484
|
|
|
|
|
14728
|
$self->{MMB_seqnr} = -1; # for overloaded body comparison |
40
|
|
|
|
|
|
|
$self->{MMBD_message} = $args->{message} |
41
|
1484
|
50
|
|
|
|
3216
|
or $self->log(INTERNAL => "A message must be specified to a delayed body."); |
42
|
|
|
|
|
|
|
|
43
|
1484
|
|
|
|
|
3827
|
weaken($self->{MMBD_message}); |
44
|
1484
|
|
|
|
|
3216
|
$self; |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
#------------------------------------------ |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
|
50
|
1537
|
|
|
1537
|
1
|
15315
|
sub message() { shift->{MMBD_message} } |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
#------------------------------------------ |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
sub modified(;$) |
56
|
859
|
100
|
66
|
859
|
1
|
2401
|
{ return 0 if @_==1 || !$_[1]; |
57
|
1
|
|
|
|
|
37
|
shift->forceRealize(shift); |
58
|
|
|
|
|
|
|
} |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
sub isModified() {0} |
62
|
|
|
|
|
|
|
sub isDelayed() {1} |
63
|
1
|
|
|
1
|
1
|
4
|
sub isMultipart() {shift->message->head->isMultipart} |
64
|
135
|
|
|
135
|
1
|
45811
|
sub guessSize() {shift->{MMBD_size}} |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
sub nrLines() |
68
|
90
|
|
|
90
|
1
|
383
|
{ my ($self) = @_; |
69
|
|
|
|
|
|
|
defined $self->{MMBD_lines} |
70
|
|
|
|
|
|
|
? $self->{MMBD_lines} |
71
|
90
|
50
|
|
|
|
315
|
: $_[0]->forceRealize->nrLines; |
72
|
|
|
|
|
|
|
} |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
sub string_unless_carp() |
75
|
80
|
|
|
80
|
0
|
56970
|
{ my $self = shift; |
76
|
80
|
50
|
|
|
|
357
|
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
|
39681
|
{ my ($self, $parser, $head, $bodytype) = splice @_, 0, 4; |
87
|
747
|
|
|
|
|
1496
|
$self->{MMBD_parser} = $parser; |
88
|
|
|
|
|
|
|
|
89
|
747
|
|
|
|
|
2002
|
@$self{ qw/MMBD_begin MMBD_end MMBD_size MMBD_lines/ } |
90
|
|
|
|
|
|
|
= $parser->bodyDelayed(@_); |
91
|
|
|
|
|
|
|
|
92
|
747
|
|
|
|
|
253774
|
$self; |
93
|
|
|
|
|
|
|
} |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
sub fileLocation(;@) { |
97
|
344
|
|
|
344
|
1
|
2069
|
my $self = shift; |
98
|
344
|
50
|
|
|
|
1189
|
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
|
550
|
{ my ($self, $dist) = @_; |
105
|
134
|
|
|
|
|
183
|
$self->{MMBD_begin} -= $dist; |
106
|
134
|
|
|
|
|
167
|
$self->{MMBD_end} -= $dist; |
107
|
134
|
|
|
|
|
181
|
$self; |
108
|
|
|
|
|
|
|
} |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
|
111
|
176
|
|
|
176
|
1
|
7593
|
sub load() {$_[0] = $_[0]->message->loadBody} |
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
#------------------------------------------ |
114
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
1; |