line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# Copyrights 2001-2022 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-Message. 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::Field::AddrGroup; |
10
|
21
|
|
|
21
|
|
124
|
use vars '$VERSION'; |
|
21
|
|
|
|
|
41
|
|
|
21
|
|
|
|
|
1153
|
|
11
|
|
|
|
|
|
|
$VERSION = '3.012'; |
12
|
|
|
|
|
|
|
|
13
|
21
|
|
|
21
|
|
119
|
use base 'User::Identity::Collection::Emails'; |
|
21
|
|
|
|
|
46
|
|
|
21
|
|
|
|
|
8834
|
|
14
|
|
|
|
|
|
|
|
15
|
21
|
|
|
21
|
|
138161
|
use strict; |
|
21
|
|
|
|
|
57
|
|
|
21
|
|
|
|
|
377
|
|
16
|
21
|
|
|
21
|
|
87
|
use warnings; |
|
21
|
|
|
|
|
43
|
|
|
21
|
|
|
|
|
529
|
|
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
|
19
|
21
|
|
|
21
|
|
94
|
use overload '""' => 'string'; |
|
21
|
|
|
|
|
52
|
|
|
21
|
|
|
|
|
120
|
|
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
#------------------------------------------ |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
sub string() |
25
|
52
|
|
|
52
|
1
|
8104
|
{ my $self = shift; |
26
|
52
|
|
|
|
|
105
|
my $name = $self->name; |
27
|
52
|
|
|
|
|
246
|
my @addr = sort map $_->string, $self->addresses; |
28
|
|
|
|
|
|
|
|
29
|
52
|
|
|
|
|
150
|
local $" = ', '; |
30
|
|
|
|
|
|
|
|
31
|
52
|
100
|
|
|
|
248
|
length $name ? "$name: @addr;" |
|
|
100
|
|
|
|
|
|
32
|
|
|
|
|
|
|
: @addr ? "@addr" |
33
|
|
|
|
|
|
|
: ''; |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
#------------------------------------------ |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
sub coerce($@) |
40
|
1
|
|
|
1
|
1
|
3
|
{ my ($class, $addr, %args) = @_; |
41
|
|
|
|
|
|
|
|
42
|
1
|
50
|
|
|
|
2
|
return () unless defined $addr; |
43
|
|
|
|
|
|
|
|
44
|
1
|
50
|
|
|
|
3
|
if(ref $addr) |
45
|
1
|
50
|
|
|
|
4
|
{ return $addr if $addr->isa($class); |
46
|
|
|
|
|
|
|
|
47
|
1
|
50
|
|
|
|
6
|
return bless $addr, $class |
48
|
|
|
|
|
|
|
if $addr->isa('User::Identity::Collection::Emails'); |
49
|
|
|
|
|
|
|
} |
50
|
|
|
|
|
|
|
|
51
|
0
|
|
|
|
|
0
|
$class->log(ERROR => "Cannot coerce a ".(ref($addr)|'string'). |
52
|
|
|
|
|
|
|
" into a $class"); |
53
|
0
|
|
|
|
|
0
|
(); |
54
|
|
|
|
|
|
|
} |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
#------------------------------------------ |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
sub addAddress(@) |
61
|
25
|
|
|
25
|
1
|
37
|
{ my $self = shift; |
62
|
|
|
|
|
|
|
|
63
|
25
|
50
|
|
|
|
93
|
my $addr |
|
|
50
|
|
|
|
|
|
64
|
|
|
|
|
|
|
= @_ > 1 ? Mail::Message::Field::Address->new(@_) |
65
|
|
|
|
|
|
|
: !$_[0] ? return () |
66
|
|
|
|
|
|
|
: Mail::Message::Field::Address->coerce(shift); |
67
|
|
|
|
|
|
|
|
68
|
25
|
|
|
|
|
93
|
$self->addRole($addr); |
69
|
25
|
|
|
|
|
690
|
$addr; |
70
|
|
|
|
|
|
|
} |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
# roles are stored in a hash, so produce |
74
|
72
|
|
|
72
|
1
|
14704
|
sub addresses() { shift->roles } |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
#------------------------------------------ |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
1; |