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::Box::Message; |
10
|
34
|
|
|
34
|
|
252
|
use vars '$VERSION'; |
|
34
|
|
|
|
|
66
|
|
|
34
|
|
|
|
|
1769
|
|
11
|
|
|
|
|
|
|
$VERSION = '3.010'; |
12
|
|
|
|
|
|
|
|
13
|
34
|
|
|
34
|
|
236
|
use base 'Mail::Message'; |
|
34
|
|
|
|
|
77
|
|
|
34
|
|
|
|
|
17622
|
|
14
|
|
|
|
|
|
|
|
15
|
34
|
|
|
34
|
|
3670519
|
use strict; |
|
34
|
|
|
|
|
94
|
|
|
34
|
|
|
|
|
740
|
|
16
|
34
|
|
|
34
|
|
193
|
use warnings; |
|
34
|
|
|
|
|
108
|
|
|
34
|
|
|
|
|
908
|
|
17
|
|
|
|
|
|
|
|
18
|
34
|
|
|
34
|
|
202
|
use Scalar::Util 'weaken'; |
|
34
|
|
|
|
|
86
|
|
|
34
|
|
|
|
|
22847
|
|
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub init($) |
22
|
2041
|
|
|
2041
|
0
|
3370
|
{ my ($self, $args) = @_; |
23
|
2041
|
|
|
|
|
5649
|
$self->SUPER::init($args); |
24
|
|
|
|
|
|
|
|
25
|
2041
|
|
|
|
|
55638
|
$self->{MBM_body_type} = $args->{body_type}; |
26
|
2041
|
|
|
|
|
5445
|
$self->{MBM_folder} = $args->{folder}; |
27
|
2041
|
|
|
|
|
5970
|
weaken($self->{MBM_folder}); |
28
|
|
|
|
|
|
|
|
29
|
2041
|
50
|
|
|
|
5460
|
return $self if $self->isDummy; |
30
|
2041
|
|
|
|
|
3893
|
$self; |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
sub head(;$) |
34
|
19238
|
|
|
19238
|
1
|
140583
|
{ my $self = shift; |
35
|
19238
|
100
|
|
|
|
44508
|
return $self->SUPER::head unless @_; |
36
|
|
|
|
|
|
|
|
37
|
2337
|
|
|
|
|
3269
|
my $new = shift; |
38
|
2337
|
|
|
|
|
4886
|
my $old = $self->head; |
39
|
2337
|
|
|
|
|
13986
|
$self->SUPER::head($new); |
40
|
|
|
|
|
|
|
|
41
|
2337
|
50
|
66
|
|
|
452794
|
return unless defined $new || defined $old; |
42
|
|
|
|
|
|
|
|
43
|
2337
|
100
|
|
|
|
5479
|
my $folder = $self->folder |
44
|
|
|
|
|
|
|
or return $new; |
45
|
|
|
|
|
|
|
|
46
|
1600
|
100
|
66
|
|
|
11481
|
if(!defined $new && defined $old && !$old->isDelayed) |
|
|
50
|
66
|
|
|
|
|
|
|
|
33
|
|
|
|
|
47
|
55
|
|
|
|
|
163
|
{ $folder->messageId($self->messageId, undef); |
48
|
55
|
|
|
|
|
145
|
$folder->toBeUnthreaded($self); |
49
|
|
|
|
|
|
|
} |
50
|
|
|
|
|
|
|
elsif(defined $new && !$new->isDelayed) |
51
|
1545
|
|
|
|
|
4127
|
{ $folder->messageId($self->messageId, $self); |
52
|
1545
|
|
|
|
|
3993
|
$folder->toBeThreaded($self); |
53
|
|
|
|
|
|
|
} |
54
|
|
|
|
|
|
|
|
55
|
1600
|
100
|
|
|
|
4222
|
$new || $old; |
56
|
|
|
|
|
|
|
} |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
#------------------------------------------- |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
sub folder(;$) |
62
|
2840
|
|
|
2840
|
1
|
5728
|
{ my $self = shift; |
63
|
2840
|
100
|
|
|
|
5924
|
if(@_) |
64
|
142
|
|
|
|
|
275
|
{ $self->{MBM_folder} = shift; |
65
|
142
|
|
|
|
|
461
|
weaken($self->{MBM_folder}); |
66
|
142
|
|
|
|
|
485
|
$self->modified(1); |
67
|
|
|
|
|
|
|
} |
68
|
2840
|
|
|
|
|
13844
|
$self->{MBM_folder}; |
69
|
|
|
|
|
|
|
} |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
sub seqnr(;$) |
73
|
2420
|
|
|
2420
|
1
|
6439
|
{ my $self = shift; |
74
|
2420
|
100
|
|
|
|
6840
|
@_ ? $self->{MBM_seqnr} = shift : $self->{MBM_seqnr}; |
75
|
|
|
|
|
|
|
} |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
sub copyTo($@) |
79
|
129
|
|
|
129
|
1
|
236
|
{ my ($self, $folder) = (shift, shift); |
80
|
129
|
|
|
|
|
339
|
$folder->addMessage($self->clone(@_)); |
81
|
|
|
|
|
|
|
} |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
sub moveTo($@) |
85
|
0
|
|
|
0
|
1
|
0
|
{ my ($self, $folder, %args) = @_; |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
$args{share} = 1 |
88
|
0
|
0
|
0
|
|
|
0
|
unless exists $args{share} || exists $args{shallow_body}; |
89
|
|
|
|
|
|
|
|
90
|
0
|
|
|
|
|
0
|
my $added = $self->copyTo($folder, %args); |
91
|
0
|
|
|
|
|
0
|
$self->label(deleted => 1); |
92
|
0
|
|
|
|
|
0
|
$added; |
93
|
|
|
|
|
|
|
} |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
#------------------------------------------- |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
sub readBody($$;$) |
99
|
1572
|
|
|
1572
|
1
|
3310346
|
{ my ($self, $parser, $head, $getbodytype) = @_; |
100
|
|
|
|
|
|
|
|
101
|
1572
|
50
|
|
|
|
4148
|
unless($getbodytype) |
102
|
1572
|
|
|
|
|
2989
|
{ my $folder = $self->{MBM_folder}; |
103
|
1572
|
50
|
|
1656
|
|
7843
|
$getbodytype = sub {$folder->determineBodyType(@_)} if defined $folder; |
|
1656
|
|
|
|
|
227404
|
|
104
|
|
|
|
|
|
|
} |
105
|
|
|
|
|
|
|
|
106
|
1572
|
|
|
|
|
4913
|
$self->SUPER::readBody($parser, $head, $getbodytype); |
107
|
|
|
|
|
|
|
} |
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
|
110
|
28
|
|
|
28
|
1
|
56
|
sub diskDelete() { shift } |
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
sub forceLoad() { # compatibility |
113
|
1
|
|
|
1
|
0
|
4
|
my $self = shift; |
114
|
1
|
|
|
|
|
10
|
$self->loadBody(@_); |
115
|
1
|
|
|
|
|
8
|
$self; |
116
|
|
|
|
|
|
|
} |
117
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
#------------------------------------------- |
119
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
|
121
|
|
|
|
|
|
|
sub destruct() |
122
|
55
|
|
|
55
|
1
|
22811
|
{ require Mail::Box::Message::Destructed; |
123
|
55
|
|
|
|
|
198
|
Mail::Box::Message::Destructed->coerce(shift); |
124
|
|
|
|
|
|
|
} |
125
|
|
|
|
|
|
|
|
126
|
|
|
|
|
|
|
1; |