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-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
|
22
|
|
|
22
|
|
153
|
use vars '$VERSION'; |
|
22
|
|
|
|
|
57
|
|
|
22
|
|
|
|
|
1223
|
|
11
|
|
|
|
|
|
|
$VERSION = '3.013'; |
12
|
|
|
|
|
|
|
|
13
|
22
|
|
|
22
|
|
133
|
use base 'User::Identity::Collection::Emails'; |
|
22
|
|
|
|
|
51
|
|
|
22
|
|
|
|
|
10861
|
|
14
|
|
|
|
|
|
|
|
15
|
22
|
|
|
22
|
|
253428
|
use strict; |
|
22
|
|
|
|
|
75
|
|
|
22
|
|
|
|
|
426
|
|
16
|
22
|
|
|
22
|
|
115
|
use warnings; |
|
22
|
|
|
|
|
52
|
|
|
22
|
|
|
|
|
669
|
|
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
|
19
|
22
|
|
|
22
|
|
128
|
use overload '""' => 'string'; |
|
22
|
|
|
|
|
59
|
|
|
22
|
|
|
|
|
141
|
|
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
#------------------------------------------ |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
sub string() |
25
|
53
|
|
|
53
|
1
|
10152
|
{ my $self = shift; |
26
|
53
|
|
|
|
|
128
|
my $name = $self->name; |
27
|
53
|
|
|
|
|
318
|
my @addr = sort map $_->string, $self->addresses; |
28
|
|
|
|
|
|
|
|
29
|
53
|
|
|
|
|
477
|
local $" = ', '; |
30
|
|
|
|
|
|
|
|
31
|
53
|
100
|
|
|
|
318
|
length $name ? "$name: @addr;" |
|
|
100
|
|
|
|
|
|
32
|
|
|
|
|
|
|
: @addr ? "@addr" |
33
|
|
|
|
|
|
|
: ''; |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
#------------------------------------------ |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
sub coerce($@) |
40
|
1
|
|
|
1
|
1
|
2
|
{ my ($class, $addr, %args) = @_; |
41
|
|
|
|
|
|
|
|
42
|
1
|
50
|
|
|
|
4
|
return () unless defined $addr; |
43
|
|
|
|
|
|
|
|
44
|
1
|
50
|
|
|
|
3
|
if(ref $addr) |
45
|
1
|
50
|
|
|
|
5
|
{ return $addr if $addr->isa($class); |
46
|
|
|
|
|
|
|
|
47
|
1
|
50
|
|
|
|
5
|
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
|
26
|
|
|
26
|
1
|
49
|
{ my $self = shift; |
62
|
|
|
|
|
|
|
|
63
|
26
|
50
|
|
|
|
105
|
my $addr |
|
|
50
|
|
|
|
|
|
64
|
|
|
|
|
|
|
= @_ > 1 ? Mail::Message::Field::Address->new(@_) |
65
|
|
|
|
|
|
|
: !$_[0] ? return () |
66
|
|
|
|
|
|
|
: Mail::Message::Field::Address->coerce(shift); |
67
|
|
|
|
|
|
|
|
68
|
26
|
|
|
|
|
105
|
$self->addRole($addr); |
69
|
26
|
|
|
|
|
1333
|
$addr; |
70
|
|
|
|
|
|
|
} |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
# roles are stored in a hash, so produce |
74
|
74
|
|
|
74
|
1
|
18298
|
sub addresses() { shift->roles } |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
#------------------------------------------ |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
1; |