line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Bot::Cobalt::Core::ContextMeta::Ignore; |
2
|
|
|
|
|
|
|
$Bot::Cobalt::Core::ContextMeta::Ignore::VERSION = '0.021002'; |
3
|
6
|
|
|
6
|
|
22308
|
use strictures 2; |
|
6
|
|
|
|
|
1107
|
|
|
6
|
|
|
|
|
233
|
|
4
|
6
|
|
|
6
|
|
849
|
use Carp; |
|
6
|
|
|
|
|
8
|
|
|
6
|
|
|
|
|
292
|
|
5
|
|
|
|
|
|
|
|
6
|
6
|
|
|
6
|
|
465
|
use IRC::Utils 'normalize_mask'; |
|
6
|
|
|
|
|
14032
|
|
|
6
|
|
|
|
|
270
|
|
7
|
6
|
|
|
6
|
|
369
|
use Bot::Cobalt::Common ':types'; |
|
6
|
|
|
|
|
7
|
|
|
6
|
|
|
|
|
29
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
|
10
|
6
|
|
|
6
|
|
794
|
use Moo; |
|
6
|
|
|
|
|
5854
|
|
|
6
|
|
|
|
|
34
|
|
11
|
|
|
|
|
|
|
extends 'Bot::Cobalt::Core::ContextMeta'; |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
around add => sub { |
15
|
|
|
|
|
|
|
my $orig = shift; |
16
|
|
|
|
|
|
|
my ($self, $context, $mask, $reason, $addedby) = @_; |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
my ($pkg, $line) = (caller)[0,2]; |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
confess "Missing arguments in ignore add()" |
21
|
|
|
|
|
|
|
unless defined $context and defined $mask; |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
$mask = normalize_mask($mask); |
24
|
|
|
|
|
|
|
$addedby = $pkg unless defined $addedby; |
25
|
|
|
|
|
|
|
$reason = "Added by $pkg" unless defined $reason; |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
my $meta = +{ |
28
|
|
|
|
|
|
|
AddedBy => $addedby, |
29
|
|
|
|
|
|
|
Reason => $reason, |
30
|
|
|
|
|
|
|
}; |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
$self->$orig($context, $mask, $meta) |
33
|
|
|
|
|
|
|
}; |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
sub reason { |
36
|
1
|
|
|
1
|
1
|
279
|
my ($self, $context, $mask) = @_; |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
return unless exists $self->_list->{$context} |
39
|
1
|
50
|
33
|
|
|
20
|
and exists $self->_list->{$context}->{$mask}; |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
$self->_list->{$context}->{$mask}->{Reason} |
42
|
1
|
|
|
|
|
35
|
} |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
sub addedby { |
45
|
1
|
|
|
1
|
1
|
272
|
my ($self, $context, $mask) = @_; |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
return unless exists $self->_list->{$context} |
48
|
1
|
50
|
33
|
|
|
19
|
and exists $self->_list->{$context}->{$mask}; |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
$self->_list->{$context}->{$mask}->{AddedBy} |
51
|
1
|
|
|
|
|
44
|
} |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
1; |
54
|
|
|
|
|
|
|
__END__ |