line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# Copyrights 2001-2021 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-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
|
|
162
|
use vars '$VERSION'; |
|
21
|
|
|
|
|
52
|
|
|
21
|
|
|
|
|
1302
|
|
11
|
|
|
|
|
|
|
$VERSION = '3.011'; |
12
|
|
|
|
|
|
|
|
13
|
21
|
|
|
21
|
|
142
|
use base 'User::Identity::Collection::Emails'; |
|
21
|
|
|
|
|
61
|
|
|
21
|
|
|
|
|
11262
|
|
14
|
|
|
|
|
|
|
|
15
|
21
|
|
|
21
|
|
172296
|
use strict; |
|
21
|
|
|
|
|
57
|
|
|
21
|
|
|
|
|
456
|
|
16
|
21
|
|
|
21
|
|
109
|
use warnings; |
|
21
|
|
|
|
|
49
|
|
|
21
|
|
|
|
|
637
|
|
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
|
19
|
21
|
|
|
21
|
|
115
|
use overload '""' => 'string'; |
|
21
|
|
|
|
|
50
|
|
|
21
|
|
|
|
|
166
|
|
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
#------------------------------------------ |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
sub string() |
25
|
51
|
|
|
51
|
1
|
8686
|
{ my $self = shift; |
26
|
51
|
|
|
|
|
143
|
my $name = $self->name; |
27
|
51
|
|
|
|
|
351
|
my @addr = sort map $_->string, $self->addresses; |
28
|
|
|
|
|
|
|
|
29
|
51
|
|
|
|
|
200
|
local $" = ', '; |
30
|
|
|
|
|
|
|
|
31
|
51
|
100
|
|
|
|
346
|
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
|
|
|
|
4
|
return () unless defined $addr; |
43
|
|
|
|
|
|
|
|
44
|
1
|
50
|
|
|
|
2
|
if(ref $addr) |
45
|
1
|
50
|
|
|
|
5
|
{ 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
|
24
|
|
|
24
|
1
|
44
|
{ my $self = shift; |
62
|
|
|
|
|
|
|
|
63
|
24
|
50
|
|
|
|
105
|
my $addr |
|
|
50
|
|
|
|
|
|
64
|
|
|
|
|
|
|
= @_ > 1 ? Mail::Message::Field::Address->new(@_) |
65
|
|
|
|
|
|
|
: !$_[0] ? return () |
66
|
|
|
|
|
|
|
: Mail::Message::Field::Address->coerce(shift); |
67
|
|
|
|
|
|
|
|
68
|
24
|
|
|
|
|
130
|
$self->addRole($addr); |
69
|
24
|
|
|
|
|
855
|
$addr; |
70
|
|
|
|
|
|
|
} |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
# roles are stored in a hash, so produce |
74
|
70
|
|
|
70
|
1
|
15942
|
sub addresses() { shift->roles } |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
#------------------------------------------ |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
1; |