| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
# This code is part of Perl distribution Mail-Message version 4.04. |
|
2
|
|
|
|
|
|
|
# The POD got stripped from this file by OODoc version 3.06. |
|
3
|
|
|
|
|
|
|
# For contributors see file ChangeLog. |
|
4
|
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
# This software is copyright (c) 2001-2026 by Mark Overmeer. |
|
6
|
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
# This is free software; you can redistribute it and/or modify it under |
|
8
|
|
|
|
|
|
|
# the same terms as the Perl 5 programming language system itself. |
|
9
|
|
|
|
|
|
|
# SPDX-License-Identifier: Artistic-1.0-Perl OR GPL-1.0-or-later |
|
10
|
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
package Mail::Message::Field::AddrGroup;{ |
|
13
|
|
|
|
|
|
|
our $VERSION = '4.04'; |
|
14
|
|
|
|
|
|
|
} |
|
15
|
|
|
|
|
|
|
|
|
16
|
28
|
|
|
28
|
|
224
|
use parent 'User::Identity::Collection::Emails'; |
|
|
28
|
|
|
|
|
64
|
|
|
|
28
|
|
|
|
|
213
|
|
|
17
|
|
|
|
|
|
|
|
|
18
|
28
|
|
|
28
|
|
483817
|
use strict; |
|
|
28
|
|
|
|
|
84
|
|
|
|
28
|
|
|
|
|
746
|
|
|
19
|
28
|
|
|
28
|
|
137
|
use warnings; |
|
|
28
|
|
|
|
|
56
|
|
|
|
28
|
|
|
|
|
1876
|
|
|
20
|
|
|
|
|
|
|
|
|
21
|
28
|
|
|
28
|
|
220
|
use Log::Report 'mail-message', import => [ qw/__x error/ ]; |
|
|
28
|
|
|
|
|
62
|
|
|
|
28
|
|
|
|
|
248
|
|
|
22
|
|
|
|
|
|
|
|
|
23
|
28
|
|
|
28
|
|
5489
|
use Scalar::Util qw/blessed/; |
|
|
28
|
|
|
|
|
93
|
|
|
|
28
|
|
|
|
|
1715
|
|
|
24
|
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
#-------------------- |
|
26
|
|
|
|
|
|
|
|
|
27
|
28
|
|
|
28
|
|
275
|
use overload '""' => 'string'; |
|
|
28
|
|
|
|
|
94
|
|
|
|
28
|
|
|
|
|
341
|
|
|
28
|
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
#-------------------- |
|
30
|
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
sub string() |
|
32
|
39
|
|
|
39
|
1
|
18413
|
{ my $self = shift; |
|
33
|
39
|
|
|
|
|
137
|
my $name = $self->name; |
|
34
|
39
|
|
|
|
|
328
|
my @addr = sort map $_->string, $self->addresses; |
|
35
|
|
|
|
|
|
|
|
|
36
|
39
|
|
|
|
|
836
|
local $" = ', '; |
|
37
|
39
|
100
|
|
|
|
336
|
length $name ? "$name: @addr;" : @addr ? "@addr" : ''; |
|
|
|
100
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
} |
|
39
|
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
#-------------------- |
|
41
|
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
sub coerce($@) |
|
43
|
1
|
|
|
1
|
1
|
4
|
{ my ($class, $addr, %args) = @_; |
|
44
|
1
|
50
|
|
|
|
4
|
defined $addr or return (); |
|
45
|
|
|
|
|
|
|
|
|
46
|
1
|
50
|
|
|
|
4
|
if(blessed $addr) |
|
47
|
1
|
50
|
|
|
|
6
|
{ return $addr if $addr->isa($class); |
|
48
|
|
|
|
|
|
|
|
|
49
|
1
|
50
|
|
|
|
7
|
return bless $addr, $class |
|
50
|
|
|
|
|
|
|
if $addr->isa('User::Identity::Collection::Emails'); |
|
51
|
|
|
|
|
|
|
} |
|
52
|
|
|
|
|
|
|
|
|
53
|
0
|
|
0
|
|
|
0
|
error __x"cannot coerce a {type} into a {class}.", type => ref $addr // 'string', class => $class; |
|
54
|
|
|
|
|
|
|
} |
|
55
|
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
#-------------------- |
|
58
|
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
sub addAddress(@) |
|
60
|
45
|
|
|
45
|
1
|
86
|
{ my $self = shift; |
|
61
|
|
|
|
|
|
|
|
|
62
|
45
|
50
|
|
|
|
227
|
my $addr |
|
|
|
50
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
= @_ > 1 ? Mail::Message::Field::Address->new(@_) |
|
64
|
|
|
|
|
|
|
: !$_[0] ? return () |
|
65
|
|
|
|
|
|
|
: Mail::Message::Field::Address->coerce(shift); |
|
66
|
|
|
|
|
|
|
|
|
67
|
45
|
|
|
|
|
254
|
$self->addRole($addr); |
|
68
|
45
|
|
|
|
|
2926
|
$addr; |
|
69
|
|
|
|
|
|
|
} |
|
70
|
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
# roles are stored in a hash, so produce |
|
73
|
82
|
|
|
82
|
1
|
28455
|
sub addresses() { $_[0]->roles } |
|
74
|
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
#-------------------- |
|
76
|
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
1; |