| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package POE::Component::IRC::Plugin::ISupport; |
|
2
|
|
|
|
|
|
|
$POE::Component::IRC::Plugin::ISupport::VERSION = '6.95'; |
|
3
|
79
|
|
|
79
|
|
596
|
use strict; |
|
|
79
|
|
|
|
|
191
|
|
|
|
79
|
|
|
|
|
3508
|
|
|
4
|
79
|
|
|
79
|
|
436
|
use warnings FATAL => 'all'; |
|
|
79
|
|
|
|
|
144
|
|
|
|
79
|
|
|
|
|
5285
|
|
|
5
|
79
|
|
|
79
|
|
459
|
use POE::Component::IRC::Plugin qw(:ALL); |
|
|
79
|
|
|
|
|
171
|
|
|
|
79
|
|
|
|
|
145878
|
|
|
6
|
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
sub new { |
|
8
|
116
|
|
|
116
|
1
|
1190
|
return bless { }, shift; |
|
9
|
|
|
|
|
|
|
} |
|
10
|
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub PCI_register { |
|
12
|
116
|
|
|
116
|
0
|
6994
|
my ($self, $irc) = splice @_, 0, 2; |
|
13
|
|
|
|
|
|
|
|
|
14
|
116
|
|
|
|
|
826
|
$irc->plugin_register( $self => SERVER => qw(all) ); |
|
15
|
116
|
|
|
|
|
4937
|
$self->{irc} = $irc; |
|
16
|
|
|
|
|
|
|
$self->{parser} = { |
|
17
|
|
|
|
|
|
|
CASEMAPPING => sub { |
|
18
|
90
|
|
|
90
|
|
281
|
my ($support, $key, $val) = @_; |
|
19
|
90
|
|
|
|
|
306
|
$support->{$key} = $val; |
|
20
|
|
|
|
|
|
|
}, |
|
21
|
|
|
|
|
|
|
CHANLIMIT => sub { |
|
22
|
1
|
|
|
1
|
|
3
|
my ($support, $key, $val) = @_; |
|
23
|
1
|
|
|
|
|
12
|
while ($val =~ /([^:]+):(\d+),?/g) { |
|
24
|
1
|
|
|
|
|
8
|
my ($k, $v) = ($1, $2); |
|
25
|
1
|
|
|
|
|
4
|
@{ $support->{$key} }{ split(//, $k) } = ($v) x length $k; |
|
|
1
|
|
|
|
|
8
|
|
|
26
|
|
|
|
|
|
|
} |
|
27
|
|
|
|
|
|
|
}, |
|
28
|
|
|
|
|
|
|
CHANMODES => sub { |
|
29
|
90
|
|
|
90
|
|
341
|
my ($support, $key, $val) = @_; |
|
30
|
90
|
|
|
|
|
741
|
$support->{$key} = [ split(/,/, $val) ]; |
|
31
|
|
|
|
|
|
|
}, |
|
32
|
|
|
|
|
|
|
CHANTYPES => sub { |
|
33
|
90
|
|
|
90
|
|
325
|
my ($support, $key, $val) = @_; |
|
34
|
90
|
|
|
|
|
586
|
$support->{$key} = [ split(//, $val) ]; |
|
35
|
|
|
|
|
|
|
}, |
|
36
|
|
|
|
|
|
|
ELIST => sub { |
|
37
|
1
|
|
|
1
|
|
4
|
my ($support, $key, $val) = @_; |
|
38
|
1
|
|
|
|
|
23
|
$support->{$key} = [ split(//, $val) ]; |
|
39
|
|
|
|
|
|
|
}, |
|
40
|
|
|
|
|
|
|
IDCHAN => sub { |
|
41
|
0
|
|
|
0
|
|
0
|
my ($support, $key, $val) = @_; |
|
42
|
0
|
|
|
|
|
0
|
while ($val =~ /([^:]+):(\d+),?/g) { |
|
43
|
0
|
|
|
|
|
0
|
my ($k, $v) = ($1, $2); |
|
44
|
0
|
|
|
|
|
0
|
@{ $support->{$key} }{ split(//, $k) } = ($v) x length $k; |
|
|
0
|
|
|
|
|
0
|
|
|
45
|
|
|
|
|
|
|
} |
|
46
|
|
|
|
|
|
|
}, |
|
47
|
|
|
|
|
|
|
MAXLIST => sub { |
|
48
|
1
|
|
|
1
|
|
4
|
my ($support, $key, $val) = @_; |
|
49
|
1
|
|
|
|
|
33
|
while ($val =~ /([^:]+):(\d+),?/g) { |
|
50
|
1
|
|
|
|
|
7
|
my ($k, $v) = ($1, $2); |
|
51
|
1
|
|
|
|
|
5
|
@{ $support->{$key} }{ split(//, $k) } = ($v) x length $k; |
|
|
1
|
|
|
|
|
10
|
|
|
52
|
|
|
|
|
|
|
} |
|
53
|
|
|
|
|
|
|
}, |
|
54
|
|
|
|
|
|
|
PREFIX => sub { |
|
55
|
90
|
|
|
90
|
|
322
|
my ($support, $key, $val) = @_; |
|
56
|
90
|
50
|
|
|
|
1111
|
if (my ($k, $v) = $val =~ /\(([^)]+)\)(.*)/ ) { |
|
57
|
90
|
|
|
|
|
380
|
@{ $support->{$key} }{ split(//, $k) } = split(//, $v); |
|
|
90
|
|
|
|
|
834
|
|
|
58
|
|
|
|
|
|
|
} |
|
59
|
|
|
|
|
|
|
}, |
|
60
|
|
|
|
|
|
|
STATUSMSG => sub { |
|
61
|
1
|
|
|
1
|
|
3
|
my ($support, $key, $val) = @_; |
|
62
|
1
|
|
|
|
|
22
|
$support->{$key} = [ split(//, $val) ]; |
|
63
|
|
|
|
|
|
|
}, |
|
64
|
|
|
|
|
|
|
TARGMAX => sub { |
|
65
|
1
|
|
|
1
|
|
4
|
my ($support, $key, $val) = @_; |
|
66
|
1
|
|
|
|
|
12
|
while ($val =~ /([^:]+):(\d*),?/g) { |
|
67
|
8
|
|
|
|
|
21
|
my ($k, $v) = ($1, $2); |
|
68
|
8
|
|
|
|
|
44
|
$support->{$key}->{$k} = $v; |
|
69
|
|
|
|
|
|
|
} |
|
70
|
|
|
|
|
|
|
}, |
|
71
|
|
|
|
|
|
|
EXCEPTS => sub { |
|
72
|
90
|
|
|
90
|
|
262
|
my ($support, $flag) = @_; |
|
73
|
90
|
|
|
|
|
382
|
$support->{$flag} = 'e'; |
|
74
|
|
|
|
|
|
|
}, |
|
75
|
|
|
|
|
|
|
INVEX => sub { |
|
76
|
90
|
|
|
90
|
|
263
|
my ($support, $flag) = @_; |
|
77
|
90
|
|
|
|
|
315
|
$support->{$flag} = 'I'; |
|
78
|
|
|
|
|
|
|
}, |
|
79
|
116
|
|
|
|
|
7843
|
}; |
|
80
|
|
|
|
|
|
|
|
|
81
|
116
|
|
|
|
|
684
|
return 1; |
|
82
|
|
|
|
|
|
|
} |
|
83
|
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
sub PCI_unregister { |
|
85
|
116
|
|
|
116
|
0
|
26084
|
my ($self, $irc) = splice @_, 0, 2; |
|
86
|
116
|
|
|
|
|
460
|
delete $self->{irc}; |
|
87
|
116
|
|
|
|
|
664
|
return 1; |
|
88
|
|
|
|
|
|
|
} |
|
89
|
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
sub S_connected { |
|
91
|
91
|
|
|
91
|
0
|
45676
|
my ($self, $irc) = splice @_, 0, 2; |
|
92
|
|
|
|
|
|
|
|
|
93
|
91
|
|
|
|
|
304
|
$self->{server} = { }; |
|
94
|
91
|
|
|
|
|
269
|
$self->{got_005} = 0; |
|
95
|
91
|
|
|
|
|
760
|
$self->{done_005} = 0; |
|
96
|
91
|
|
|
|
|
632
|
return PCI_EAT_NONE; |
|
97
|
|
|
|
|
|
|
} |
|
98
|
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
sub S_005 { |
|
100
|
181
|
|
|
181
|
0
|
65634
|
my ($self, $irc, @args) = @_; |
|
101
|
181
|
|
|
|
|
393
|
my @vals = @{ ${ $args[2] } }; |
|
|
181
|
|
|
|
|
313
|
|
|
|
181
|
|
|
|
|
792
|
|
|
102
|
181
|
|
|
|
|
361
|
pop @vals; |
|
103
|
181
|
|
|
|
|
435
|
my $support = $self->{server}; |
|
104
|
|
|
|
|
|
|
|
|
105
|
181
|
|
|
|
|
484
|
for my $val (@vals) { |
|
106
|
1363
|
100
|
|
|
|
3335
|
if ($val =~ /=/) { |
|
107
|
1000
|
|
|
|
|
2727
|
my $key; |
|
108
|
1000
|
|
|
|
|
2470
|
($key, $val) = split(/=/, $val, 2); |
|
109
|
1000
|
100
|
|
|
|
2421
|
if (defined $self->{parser}->{$key}) { |
|
110
|
365
|
|
|
|
|
1089
|
$self->{parser}->{$key}->($support, $key, $val); |
|
111
|
|
|
|
|
|
|
} |
|
112
|
|
|
|
|
|
|
else { |
|
113
|
|
|
|
|
|
|
# AWAYLEN CHANNELLEN CHIDLEN CHARSET EXCEPTS INVEX KICKLEN |
|
114
|
|
|
|
|
|
|
# MAXBANS MAXCHANNELS MAXTARGETS MODES NETWORK NICKLEN STD |
|
115
|
|
|
|
|
|
|
# TOPICLEN WATCH |
|
116
|
635
|
|
|
|
|
1882
|
$support->{$key} = $val; |
|
117
|
|
|
|
|
|
|
} |
|
118
|
|
|
|
|
|
|
} |
|
119
|
|
|
|
|
|
|
else { |
|
120
|
363
|
100
|
|
|
|
1206
|
if (defined $self->{parser}->{$val}) { |
|
121
|
180
|
|
|
|
|
649
|
$self->{parser}->{$val}->($support, $val); |
|
122
|
|
|
|
|
|
|
} |
|
123
|
|
|
|
|
|
|
else { |
|
124
|
|
|
|
|
|
|
# ACCEPT CALLERID CAPAB CNOTICE CPRIVMSG FNC KNOCK MAXNICKLEN |
|
125
|
|
|
|
|
|
|
# NAMESX NOQUIT PENALTY RFC2812 SAFELIST UHNAMES USERIP |
|
126
|
|
|
|
|
|
|
# VCHANS WALLCHOPS WALLVOICES WHOX |
|
127
|
183
|
|
|
|
|
574
|
$support->{$val} = 'on'; |
|
128
|
|
|
|
|
|
|
} |
|
129
|
|
|
|
|
|
|
} |
|
130
|
|
|
|
|
|
|
} |
|
131
|
|
|
|
|
|
|
|
|
132
|
181
|
|
|
|
|
1340
|
$self->{got_005}++; |
|
133
|
181
|
|
|
|
|
934
|
return PCI_EAT_NONE; |
|
134
|
|
|
|
|
|
|
} |
|
135
|
|
|
|
|
|
|
|
|
136
|
|
|
|
|
|
|
sub _default { |
|
137
|
3630
|
|
|
3630
|
|
1338395
|
my ($self, $irc, $event) = @_; |
|
138
|
|
|
|
|
|
|
|
|
139
|
3630
|
100
|
|
|
|
14773
|
return PCI_EAT_NONE if $self->{done_005}; |
|
140
|
1320
|
100
|
|
|
|
7148
|
return PCI_EAT_NONE if !$self->{got_005}; |
|
141
|
|
|
|
|
|
|
|
|
142
|
107
|
100
|
66
|
|
|
1625
|
if ($event =~ /^S_(\d+)/ and $1 > 5) { |
|
143
|
90
|
|
|
|
|
465
|
$self->{done_005} = 1; |
|
144
|
90
|
|
|
|
|
655
|
$irc->send_event_now(irc_isupport => $self); |
|
145
|
|
|
|
|
|
|
} |
|
146
|
|
|
|
|
|
|
|
|
147
|
107
|
|
|
|
|
14446
|
return PCI_EAT_NONE; |
|
148
|
|
|
|
|
|
|
} |
|
149
|
|
|
|
|
|
|
|
|
150
|
|
|
|
|
|
|
sub isupport { |
|
151
|
2044
|
|
|
2044
|
1
|
7960
|
my $self = shift; |
|
152
|
2044
|
|
50
|
|
|
6123
|
my $value = uc ( $_[0] ) || return; |
|
153
|
|
|
|
|
|
|
|
|
154
|
2044
|
100
|
|
|
|
10796
|
return $self->{server}->{$value} if defined $self->{server}->{$value}; |
|
155
|
425
|
|
|
|
|
1823
|
return; |
|
156
|
|
|
|
|
|
|
} |
|
157
|
|
|
|
|
|
|
|
|
158
|
|
|
|
|
|
|
sub isupport_dump_keys { |
|
159
|
1
|
|
|
1
|
1
|
1063
|
my $self = shift; |
|
160
|
|
|
|
|
|
|
|
|
161
|
1
|
50
|
|
|
|
6
|
if ( keys %{ $self->{server} } > 0 ) { |
|
|
1
|
|
|
|
|
11
|
|
|
162
|
1
|
|
|
|
|
5
|
return keys %{ $self->{server} }; |
|
|
1
|
|
|
|
|
14
|
|
|
163
|
|
|
|
|
|
|
} |
|
164
|
0
|
|
|
|
|
|
return; |
|
165
|
|
|
|
|
|
|
} |
|
166
|
|
|
|
|
|
|
|
|
167
|
|
|
|
|
|
|
1; |
|
168
|
|
|
|
|
|
|
|
|
169
|
|
|
|
|
|
|
=encoding utf8 |
|
170
|
|
|
|
|
|
|
|
|
171
|
|
|
|
|
|
|
=head1 NAME |
|
172
|
|
|
|
|
|
|
|
|
173
|
|
|
|
|
|
|
POE::Component::IRC::Plugin::ISupport - A PoCo-IRC plugin that handles server |
|
174
|
|
|
|
|
|
|
capabilities |
|
175
|
|
|
|
|
|
|
|
|
176
|
|
|
|
|
|
|
=head1 DESCRIPTION |
|
177
|
|
|
|
|
|
|
|
|
178
|
|
|
|
|
|
|
This handles the C messages that come from the server. They |
|
179
|
|
|
|
|
|
|
define the capabilities support by the server. |
|
180
|
|
|
|
|
|
|
|
|
181
|
|
|
|
|
|
|
=head1 METHODS |
|
182
|
|
|
|
|
|
|
|
|
183
|
|
|
|
|
|
|
=head2 C |
|
184
|
|
|
|
|
|
|
|
|
185
|
|
|
|
|
|
|
Takes no arguments. |
|
186
|
|
|
|
|
|
|
|
|
187
|
|
|
|
|
|
|
Returns a plugin object suitable for feeding to |
|
188
|
|
|
|
|
|
|
L's C method. |
|
189
|
|
|
|
|
|
|
|
|
190
|
|
|
|
|
|
|
=head2 C |
|
191
|
|
|
|
|
|
|
|
|
192
|
|
|
|
|
|
|
Takes one argument. the server capability to query. Returns a false value on |
|
193
|
|
|
|
|
|
|
failure or a value representing the applicable capability. A full list of |
|
194
|
|
|
|
|
|
|
capabilities is available at L. |
|
195
|
|
|
|
|
|
|
|
|
196
|
|
|
|
|
|
|
=head2 C |
|
197
|
|
|
|
|
|
|
|
|
198
|
|
|
|
|
|
|
Takes no arguments, returns a list of the available server capabilities, |
|
199
|
|
|
|
|
|
|
which can be used with C. |
|
200
|
|
|
|
|
|
|
|
|
201
|
|
|
|
|
|
|
=head1 INPUT |
|
202
|
|
|
|
|
|
|
|
|
203
|
|
|
|
|
|
|
This module handles the following PoCo-IRC signals: |
|
204
|
|
|
|
|
|
|
|
|
205
|
|
|
|
|
|
|
=head2 C (RPL_ISUPPORT or RPL_PROTOCTL) |
|
206
|
|
|
|
|
|
|
|
|
207
|
|
|
|
|
|
|
Denotes the capabilities of the server. |
|
208
|
|
|
|
|
|
|
|
|
209
|
|
|
|
|
|
|
=head2 C |
|
210
|
|
|
|
|
|
|
|
|
211
|
|
|
|
|
|
|
Once the next signal is received that is I than C, |
|
212
|
|
|
|
|
|
|
it emits an C signal. |
|
213
|
|
|
|
|
|
|
|
|
214
|
|
|
|
|
|
|
=head1 OUTPUT EVENTS |
|
215
|
|
|
|
|
|
|
|
|
216
|
|
|
|
|
|
|
=head2 C |
|
217
|
|
|
|
|
|
|
|
|
218
|
|
|
|
|
|
|
Emitted by: the first signal received after C |
|
219
|
|
|
|
|
|
|
|
|
220
|
|
|
|
|
|
|
C will be the plugin object itself for ease of use. |
|
221
|
|
|
|
|
|
|
|
|
222
|
|
|
|
|
|
|
This is emitted when the support report has finished. |
|
223
|
|
|
|
|
|
|
|
|
224
|
|
|
|
|
|
|
=head1 AUTHOR |
|
225
|
|
|
|
|
|
|
|
|
226
|
|
|
|
|
|
|
Jeff C Pinyan, F |
|
227
|
|
|
|
|
|
|
|
|
228
|
|
|
|
|
|
|
=head1 SEE ALSO |
|
229
|
|
|
|
|
|
|
|
|
230
|
|
|
|
|
|
|
L |
|
231
|
|
|
|
|
|
|
|
|
232
|
|
|
|
|
|
|
L |
|
233
|
|
|
|
|
|
|
|
|
234
|
|
|
|
|
|
|
=cut |