line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Bot::Cobalt::IRC::Server; |
2
|
|
|
|
|
|
|
$Bot::Cobalt::IRC::Server::VERSION = '0.021003'; |
3
|
|
|
|
|
|
|
## A server context. |
4
|
|
|
|
|
|
|
|
5
|
6
|
|
|
6
|
|
13308
|
use v5.10; |
|
6
|
|
|
|
|
14
|
|
6
|
6
|
|
|
6
|
|
439
|
use strictures 2; |
|
6
|
|
|
|
|
1142
|
|
|
6
|
|
|
|
|
172
|
|
7
|
|
|
|
|
|
|
|
8
|
6
|
|
|
6
|
|
1242
|
use Bot::Cobalt::Common qw/:types/; |
|
6
|
|
|
|
|
8
|
|
|
6
|
|
|
|
|
35
|
|
9
|
6
|
|
|
6
|
|
28
|
use IRC::Utils qw/lc_irc uc_irc/; |
|
6
|
|
|
|
|
8
|
|
|
6
|
|
|
|
|
295
|
|
10
|
|
|
|
|
|
|
|
11
|
6
|
|
|
6
|
|
447
|
use Moo; |
|
6
|
|
|
|
|
5817
|
|
|
6
|
|
|
|
|
31
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
has name => ( |
14
|
|
|
|
|
|
|
required => 1, |
15
|
|
|
|
|
|
|
is => 'rw', |
16
|
|
|
|
|
|
|
isa => Str, |
17
|
|
|
|
|
|
|
); |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
has prefer_nick => ( |
20
|
|
|
|
|
|
|
required => 1, |
21
|
|
|
|
|
|
|
is => 'rw', |
22
|
|
|
|
|
|
|
isa => Str, |
23
|
|
|
|
|
|
|
); |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
has irc => ( |
26
|
|
|
|
|
|
|
is => 'rw', |
27
|
|
|
|
|
|
|
isa => Object, |
28
|
|
|
|
|
|
|
predicate => 'has_irc', |
29
|
|
|
|
|
|
|
clearer => 'clear_irc', |
30
|
|
|
|
|
|
|
); |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
has connected => ( |
33
|
|
|
|
|
|
|
lazy => 1, |
34
|
|
|
|
|
|
|
is => 'rw', |
35
|
|
|
|
|
|
|
isa => Bool, |
36
|
|
|
|
|
|
|
clearer => 'clear_connected', |
37
|
|
|
|
|
|
|
default => sub { 0 }, |
38
|
|
|
|
|
|
|
); |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
has connectedat => ( |
41
|
|
|
|
|
|
|
lazy => 1, |
42
|
|
|
|
|
|
|
is => 'rw', |
43
|
|
|
|
|
|
|
isa => Num, |
44
|
|
|
|
|
|
|
default => sub { 0 }, |
45
|
|
|
|
|
|
|
); |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
has casemap => ( |
48
|
|
|
|
|
|
|
lazy => 1, |
49
|
|
|
|
|
|
|
is => 'rw', |
50
|
|
|
|
|
|
|
isa => Str, |
51
|
|
|
|
|
|
|
default => sub { 'rfc1459' }, |
52
|
|
|
|
|
|
|
); |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
has maxmodes => ( |
55
|
|
|
|
|
|
|
lazy => 1, |
56
|
|
|
|
|
|
|
is => 'rw', |
57
|
|
|
|
|
|
|
isa => Int, |
58
|
|
|
|
|
|
|
default => sub { 3 }, |
59
|
|
|
|
|
|
|
); |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
has maxtargets => ( |
62
|
|
|
|
|
|
|
lazy => 1, |
63
|
|
|
|
|
|
|
is => 'rw', |
64
|
|
|
|
|
|
|
isa => Int, |
65
|
|
|
|
|
|
|
default => sub { 4 }, |
66
|
|
|
|
|
|
|
); |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
sub lowercase { |
69
|
2
|
|
|
2
|
1
|
752
|
my ($self, $string) = @_; |
70
|
2
|
|
50
|
|
|
44
|
lc_irc( $string // '', $self->casemap ) |
71
|
|
|
|
|
|
|
} |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
sub uppercase { |
74
|
2
|
|
|
2
|
1
|
10045
|
my ($self, $string) = @_; |
75
|
2
|
|
50
|
|
|
45
|
uc_irc( $string // '', $self->casemap ) |
76
|
|
|
|
|
|
|
} |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
1; |
79
|
|
|
|
|
|
|
__END__ |