line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# Copyrights 2001-2023 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.03. |
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
|
|
10034
|
use vars '$VERSION'; |
|
28
|
|
|
|
|
223
|
|
|
28
|
|
|
|
|
1525
|
|
11
|
|
|
|
|
|
|
$VERSION = '3.010'; |
12
|
|
|
|
|
|
|
|
13
|
28
|
|
|
28
|
|
173
|
use base 'Mail::Reporter'; |
|
28
|
|
|
|
|
108
|
|
|
28
|
|
|
|
|
2761
|
|
14
|
|
|
|
|
|
|
|
15
|
28
|
|
|
28
|
|
571
|
use strict; |
|
28
|
|
|
|
|
59
|
|
|
28
|
|
|
|
|
750
|
|
16
|
28
|
|
|
28
|
|
161
|
use warnings; |
|
28
|
|
|
|
|
85
|
|
|
28
|
|
|
|
|
1420
|
|
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
use Object::Realize::Later |
19
|
28
|
|
|
|
|
209
|
becomes => 'Mail::Message::Body', |
20
|
|
|
|
|
|
|
realize => 'load', |
21
|
|
|
|
|
|
|
warn_realization => 0, |
22
|
28
|
|
|
28
|
|
14007
|
believe_caller => 1; |
|
28
|
|
|
|
|
34608
|
|
23
|
|
|
|
|
|
|
|
24
|
28
|
|
|
28
|
|
115357
|
use Carp; |
|
28
|
|
|
|
|
87
|
|
|
28
|
|
|
|
|
1511
|
|
25
|
28
|
|
|
28
|
|
187
|
use Scalar::Util 'weaken'; |
|
28
|
|
|
|
|
58
|
|
|
28
|
|
|
|
|
2350
|
|
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
use overload '""' => 'string_unless_carp' |
29
|
4256
|
|
|
4256
|
|
51128
|
, bool => sub {1} |
30
|
28
|
|
|
28
|
|
210
|
, '@{}' => sub {shift->load->lines}; |
|
28
|
|
|
2
|
|
56
|
|
|
28
|
|
|
|
|
342
|
|
|
2
|
|
|
|
|
715
|
|
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
#------------------------------------------ |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
sub init($) |
36
|
1484
|
|
|
1484
|
0
|
677358
|
{ my ($self, $args) = @_; |
37
|
1484
|
|
|
|
|
4093
|
$self->SUPER::init($args); |
38
|
|
|
|
|
|
|
|
39
|
1484
|
|
|
|
|
16028
|
$self->{MMB_seqnr} = -1; # for overloaded body comparison |
40
|
|
|
|
|
|
|
$self->{MMBD_message} = $args->{message} |
41
|
1484
|
50
|
|
|
|
3920
|
or $self->log(INTERNAL => "A message must be specified to a delayed body."); |
42
|
|
|
|
|
|
|
|
43
|
1484
|
|
|
|
|
4593
|
weaken($self->{MMBD_message}); |
44
|
1484
|
|
|
|
|
3857
|
$self; |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
#------------------------------------------ |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
|
50
|
1537
|
|
|
1537
|
1
|
18730
|
sub message() { shift->{MMBD_message} } |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
#------------------------------------------ |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
sub modified(;$) |
56
|
859
|
100
|
66
|
859
|
1
|
2991
|
{ return 0 if @_==1 || !$_[1]; |
57
|
1
|
|
|
|
|
40
|
shift->forceRealize(shift); |
58
|
|
|
|
|
|
|
} |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
sub isModified() {0} |
62
|
|
|
|
|
|
|
sub isDelayed() {1} |
63
|
1
|
|
|
1
|
1
|
10
|
sub isMultipart() {shift->message->head->isMultipart} |
64
|
135
|
|
|
135
|
1
|
44187
|
sub guessSize() {shift->{MMBD_size}} |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
sub nrLines() |
68
|
90
|
|
|
90
|
1
|
338
|
{ my ($self) = @_; |
69
|
|
|
|
|
|
|
defined $self->{MMBD_lines} |
70
|
|
|
|
|
|
|
? $self->{MMBD_lines} |
71
|
90
|
50
|
|
|
|
334
|
: $_[0]->forceRealize->nrLines; |
72
|
|
|
|
|
|
|
} |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
sub string_unless_carp() |
75
|
80
|
|
|
80
|
0
|
70275
|
{ my $self = shift; |
76
|
80
|
50
|
|
|
|
422
|
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
|
39040
|
{ my ($self, $parser, $head, $bodytype) = splice @_, 0, 4; |
87
|
747
|
|
|
|
|
1650
|
$self->{MMBD_parser} = $parser; |
88
|
|
|
|
|
|
|
|
89
|
747
|
|
|
|
|
2441
|
@$self{ qw/MMBD_begin MMBD_end MMBD_size MMBD_lines/ } |
90
|
|
|
|
|
|
|
= $parser->bodyDelayed(@_); |
91
|
|
|
|
|
|
|
|
92
|
747
|
|
|
|
|
307302
|
$self; |
93
|
|
|
|
|
|
|
} |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
sub fileLocation(;@) { |
97
|
344
|
|
|
344
|
1
|
2514
|
my $self = shift; |
98
|
344
|
50
|
|
|
|
1680
|
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
|
662
|
{ my ($self, $dist) = @_; |
105
|
134
|
|
|
|
|
241
|
$self->{MMBD_begin} -= $dist; |
106
|
134
|
|
|
|
|
180
|
$self->{MMBD_end} -= $dist; |
107
|
134
|
|
|
|
|
223
|
$self; |
108
|
|
|
|
|
|
|
} |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
|
111
|
176
|
|
|
176
|
1
|
10166
|
sub load() {$_[0] = $_[0]->message->loadBody} |
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
#------------------------------------------ |
114
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
1; |