line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package POE::Component::IRC::Plugin::ISupport; |
2
|
|
|
|
|
|
|
our $AUTHORITY = 'cpan:HINRIK'; |
3
|
|
|
|
|
|
|
$POE::Component::IRC::Plugin::ISupport::VERSION = '6.92'; |
4
|
79
|
|
|
79
|
|
722
|
use strict; |
|
79
|
|
|
|
|
187
|
|
|
79
|
|
|
|
|
2979
|
|
5
|
79
|
|
|
79
|
|
482
|
use warnings FATAL => 'all'; |
|
79
|
|
|
|
|
194
|
|
|
79
|
|
|
|
|
3681
|
|
6
|
79
|
|
|
79
|
|
493
|
use POE::Component::IRC::Plugin qw(:ALL); |
|
79
|
|
|
|
|
192
|
|
|
79
|
|
|
|
|
131362
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
sub new { |
9
|
116
|
|
|
116
|
1
|
919
|
return bless { }, shift; |
10
|
|
|
|
|
|
|
} |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub PCI_register { |
13
|
116
|
|
|
116
|
0
|
6102
|
my ($self, $irc) = splice @_, 0, 2; |
14
|
|
|
|
|
|
|
|
15
|
116
|
|
|
|
|
523
|
$irc->plugin_register( $self => SERVER => qw(all) ); |
16
|
116
|
|
|
|
|
4883
|
$self->{irc} = $irc; |
17
|
|
|
|
|
|
|
$self->{parser} = { |
18
|
|
|
|
|
|
|
CASEMAPPING => sub { |
19
|
90
|
|
|
90
|
|
311
|
my ($support, $key, $val) = @_; |
20
|
90
|
|
|
|
|
320
|
$support->{$key} = $val; |
21
|
|
|
|
|
|
|
}, |
22
|
|
|
|
|
|
|
CHANLIMIT => sub { |
23
|
1
|
|
|
1
|
|
13
|
my ($support, $key, $val) = @_; |
24
|
1
|
|
|
|
|
18
|
while ($val =~ /([^:]+):(\d+),?/g) { |
25
|
1
|
|
|
|
|
14
|
my ($k, $v) = ($1, $2); |
26
|
1
|
|
|
|
|
6
|
@{ $support->{$key} }{ split(//, $k) } = ($v) x length $k; |
|
1
|
|
|
|
|
9
|
|
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
}, |
29
|
|
|
|
|
|
|
CHANMODES => sub { |
30
|
90
|
|
|
90
|
|
307
|
my ($support, $key, $val) = @_; |
31
|
90
|
|
|
|
|
525
|
$support->{$key} = [ split(/,/, $val) ]; |
32
|
|
|
|
|
|
|
}, |
33
|
|
|
|
|
|
|
CHANTYPES => sub { |
34
|
90
|
|
|
90
|
|
341
|
my ($support, $key, $val) = @_; |
35
|
90
|
|
|
|
|
523
|
$support->{$key} = [ split(//, $val) ]; |
36
|
|
|
|
|
|
|
}, |
37
|
|
|
|
|
|
|
ELIST => sub { |
38
|
1
|
|
|
1
|
|
5
|
my ($support, $key, $val) = @_; |
39
|
1
|
|
|
|
|
6
|
$support->{$key} = [ split(//, $val) ]; |
40
|
|
|
|
|
|
|
}, |
41
|
|
|
|
|
|
|
IDCHAN => sub { |
42
|
0
|
|
|
0
|
|
0
|
my ($support, $key, $val) = @_; |
43
|
0
|
|
|
|
|
0
|
while ($val =~ /([^:]+):(\d+),?/g) { |
44
|
0
|
|
|
|
|
0
|
my ($k, $v) = ($1, $2); |
45
|
0
|
|
|
|
|
0
|
@{ $support->{$key} }{ split(//, $k) } = ($v) x length $k; |
|
0
|
|
|
|
|
0
|
|
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
}, |
48
|
|
|
|
|
|
|
MAXLIST => sub { |
49
|
1
|
|
|
1
|
|
4
|
my ($support, $key, $val) = @_; |
50
|
1
|
|
|
|
|
8
|
while ($val =~ /([^:]+):(\d+),?/g) { |
51
|
1
|
|
|
|
|
6
|
my ($k, $v) = ($1, $2); |
52
|
1
|
|
|
|
|
5
|
@{ $support->{$key} }{ split(//, $k) } = ($v) x length $k; |
|
1
|
|
|
|
|
20
|
|
53
|
|
|
|
|
|
|
} |
54
|
|
|
|
|
|
|
}, |
55
|
|
|
|
|
|
|
PREFIX => sub { |
56
|
90
|
|
|
90
|
|
306
|
my ($support, $key, $val) = @_; |
57
|
90
|
50
|
|
|
|
968
|
if (my ($k, $v) = $val =~ /\(([^)]+)\)(.*)/ ) { |
58
|
90
|
|
|
|
|
367
|
@{ $support->{$key} }{ split(//, $k) } = split(//, $v); |
|
90
|
|
|
|
|
603
|
|
59
|
|
|
|
|
|
|
} |
60
|
|
|
|
|
|
|
}, |
61
|
|
|
|
|
|
|
STATUSMSG => sub { |
62
|
1
|
|
|
1
|
|
3
|
my ($support, $key, $val) = @_; |
63
|
1
|
|
|
|
|
4
|
$support->{$key} = [ split(//, $val) ]; |
64
|
|
|
|
|
|
|
}, |
65
|
|
|
|
|
|
|
TARGMAX => sub { |
66
|
1
|
|
|
1
|
|
5
|
my ($support, $key, $val) = @_; |
67
|
1
|
|
|
|
|
8
|
while ($val =~ /([^:]+):(\d*),?/g) { |
68
|
8
|
|
|
|
|
23
|
my ($k, $v) = ($1, $2); |
69
|
8
|
|
|
|
|
52
|
$support->{$key}->{$k} = $v; |
70
|
|
|
|
|
|
|
} |
71
|
|
|
|
|
|
|
}, |
72
|
|
|
|
|
|
|
EXCEPTS => sub { |
73
|
90
|
|
|
90
|
|
285
|
my ($support, $flag) = @_; |
74
|
90
|
|
|
|
|
429
|
$support->{$flag} = 'e'; |
75
|
|
|
|
|
|
|
}, |
76
|
|
|
|
|
|
|
INVEX => sub { |
77
|
90
|
|
|
90
|
|
257
|
my ($support, $flag) = @_; |
78
|
90
|
|
|
|
|
265
|
$support->{$flag} = 'I'; |
79
|
|
|
|
|
|
|
}, |
80
|
116
|
|
|
|
|
9898
|
}; |
81
|
|
|
|
|
|
|
|
82
|
116
|
|
|
|
|
722
|
return 1; |
83
|
|
|
|
|
|
|
} |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
sub PCI_unregister { |
86
|
116
|
|
|
116
|
0
|
22100
|
my ($self, $irc) = splice @_, 0, 2; |
87
|
116
|
|
|
|
|
337
|
delete $self->{irc}; |
88
|
116
|
|
|
|
|
353
|
return 1; |
89
|
|
|
|
|
|
|
} |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
sub S_connected { |
92
|
90
|
|
|
90
|
0
|
39974
|
my ($self, $irc) = splice @_, 0, 2; |
93
|
|
|
|
|
|
|
|
94
|
90
|
|
|
|
|
322
|
$self->{server} = { }; |
95
|
90
|
|
|
|
|
263
|
$self->{got_005} = 0; |
96
|
90
|
|
|
|
|
283
|
$self->{done_005} = 0; |
97
|
90
|
|
|
|
|
270
|
return PCI_EAT_NONE; |
98
|
|
|
|
|
|
|
} |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
sub S_005 { |
101
|
181
|
|
|
181
|
0
|
55011
|
my ($self, $irc, @args) = @_; |
102
|
181
|
|
|
|
|
377
|
my @vals = @{ ${ $args[2] } }; |
|
181
|
|
|
|
|
296
|
|
|
181
|
|
|
|
|
692
|
|
103
|
181
|
|
|
|
|
365
|
pop @vals; |
104
|
181
|
|
|
|
|
474
|
my $support = $self->{server}; |
105
|
|
|
|
|
|
|
|
106
|
181
|
|
|
|
|
438
|
for my $val (@vals) { |
107
|
1364
|
100
|
|
|
|
3910
|
if ($val =~ /=/) { |
108
|
999
|
|
|
|
|
1405
|
my $key; |
109
|
999
|
|
|
|
|
2370
|
($key, $val) = split(/=/, $val, 2); |
110
|
999
|
100
|
|
|
|
2287
|
if (defined $self->{parser}->{$key}) { |
111
|
365
|
|
|
|
|
1195
|
$self->{parser}->{$key}->($support, $key, $val); |
112
|
|
|
|
|
|
|
} |
113
|
|
|
|
|
|
|
else { |
114
|
|
|
|
|
|
|
# AWAYLEN CHANNELLEN CHIDLEN CHARSET EXCEPTS INVEX KICKLEN |
115
|
|
|
|
|
|
|
# MAXBANS MAXCHANNELS MAXTARGETS MODES NETWORK NICKLEN STD |
116
|
|
|
|
|
|
|
# TOPICLEN WATCH |
117
|
634
|
|
|
|
|
1664
|
$support->{$key} = $val; |
118
|
|
|
|
|
|
|
} |
119
|
|
|
|
|
|
|
} |
120
|
|
|
|
|
|
|
else { |
121
|
365
|
100
|
|
|
|
1019
|
if (defined $self->{parser}->{$val}) { |
122
|
180
|
|
|
|
|
717
|
$self->{parser}->{$val}->($support, $val); |
123
|
|
|
|
|
|
|
} |
124
|
|
|
|
|
|
|
else { |
125
|
|
|
|
|
|
|
# ACCEPT CALLERID CAPAB CNOTICE CPRIVMSG FNC KNOCK MAXNICKLEN |
126
|
|
|
|
|
|
|
# NAMESX NOQUIT PENALTY RFC2812 SAFELIST UHNAMES USERIP |
127
|
|
|
|
|
|
|
# VCHANS WALLCHOPS WALLVOICES WHOX |
128
|
185
|
|
|
|
|
787
|
$support->{$val} = 'on'; |
129
|
|
|
|
|
|
|
} |
130
|
|
|
|
|
|
|
} |
131
|
|
|
|
|
|
|
} |
132
|
|
|
|
|
|
|
|
133
|
181
|
|
|
|
|
368
|
$self->{got_005}++; |
134
|
181
|
|
|
|
|
692
|
return PCI_EAT_NONE; |
135
|
|
|
|
|
|
|
} |
136
|
|
|
|
|
|
|
|
137
|
|
|
|
|
|
|
sub _default { |
138
|
3652
|
|
|
3652
|
|
1195338
|
my ($self, $irc, $event) = @_; |
139
|
|
|
|
|
|
|
|
140
|
3652
|
100
|
|
|
|
12554
|
return PCI_EAT_NONE if $self->{done_005}; |
141
|
1319
|
100
|
|
|
|
4225
|
return PCI_EAT_NONE if !$self->{got_005}; |
142
|
|
|
|
|
|
|
|
143
|
107
|
100
|
66
|
|
|
1456
|
if ($event =~ /^S_(\d+)/ and $1 > 5) { |
144
|
90
|
|
|
|
|
329
|
$self->{done_005} = 1; |
145
|
90
|
|
|
|
|
658
|
$irc->send_event_now(irc_isupport => $self); |
146
|
|
|
|
|
|
|
} |
147
|
|
|
|
|
|
|
|
148
|
107
|
|
|
|
|
13220
|
return PCI_EAT_NONE; |
149
|
|
|
|
|
|
|
} |
150
|
|
|
|
|
|
|
|
151
|
|
|
|
|
|
|
sub isupport { |
152
|
2042
|
|
|
2042
|
1
|
6407
|
my $self = shift; |
153
|
2042
|
|
50
|
|
|
5463
|
my $value = uc ( $_[0] ) || return; |
154
|
|
|
|
|
|
|
|
155
|
2042
|
100
|
|
|
|
9655
|
return $self->{server}->{$value} if defined $self->{server}->{$value}; |
156
|
425
|
|
|
|
|
1875
|
return; |
157
|
|
|
|
|
|
|
} |
158
|
|
|
|
|
|
|
|
159
|
|
|
|
|
|
|
sub isupport_dump_keys { |
160
|
1
|
|
|
1
|
1
|
1002
|
my $self = shift; |
161
|
|
|
|
|
|
|
|
162
|
1
|
50
|
|
|
|
3
|
if ( keys %{ $self->{server} } > 0 ) { |
|
1
|
|
|
|
|
16
|
|
163
|
1
|
|
|
|
|
3
|
return keys %{ $self->{server} }; |
|
1
|
|
|
|
|
9
|
|
164
|
|
|
|
|
|
|
} |
165
|
0
|
|
|
|
|
|
return; |
166
|
|
|
|
|
|
|
} |
167
|
|
|
|
|
|
|
|
168
|
|
|
|
|
|
|
1; |
169
|
|
|
|
|
|
|
|
170
|
|
|
|
|
|
|
=encoding utf8 |
171
|
|
|
|
|
|
|
|
172
|
|
|
|
|
|
|
=head1 NAME |
173
|
|
|
|
|
|
|
|
174
|
|
|
|
|
|
|
POE::Component::IRC::Plugin::ISupport - A PoCo-IRC plugin that handles server |
175
|
|
|
|
|
|
|
capabilities |
176
|
|
|
|
|
|
|
|
177
|
|
|
|
|
|
|
=head1 DESCRIPTION |
178
|
|
|
|
|
|
|
|
179
|
|
|
|
|
|
|
This handles the C messages that come from the server. They |
180
|
|
|
|
|
|
|
define the capabilities support by the server. |
181
|
|
|
|
|
|
|
|
182
|
|
|
|
|
|
|
=head1 METHODS |
183
|
|
|
|
|
|
|
|
184
|
|
|
|
|
|
|
=head2 C |
185
|
|
|
|
|
|
|
|
186
|
|
|
|
|
|
|
Takes no arguments. |
187
|
|
|
|
|
|
|
|
188
|
|
|
|
|
|
|
Returns a plugin object suitable for feeding to |
189
|
|
|
|
|
|
|
L's C method. |
190
|
|
|
|
|
|
|
|
191
|
|
|
|
|
|
|
=head2 C |
192
|
|
|
|
|
|
|
|
193
|
|
|
|
|
|
|
Takes one argument. the server capability to query. Returns a false value on |
194
|
|
|
|
|
|
|
failure or a value representing the applicable capability. A full list of |
195
|
|
|
|
|
|
|
capabilities is available at L. |
196
|
|
|
|
|
|
|
|
197
|
|
|
|
|
|
|
=head2 C |
198
|
|
|
|
|
|
|
|
199
|
|
|
|
|
|
|
Takes no arguments, returns a list of the available server capabilities, |
200
|
|
|
|
|
|
|
which can be used with C. |
201
|
|
|
|
|
|
|
|
202
|
|
|
|
|
|
|
=head1 INPUT |
203
|
|
|
|
|
|
|
|
204
|
|
|
|
|
|
|
This module handles the following PoCo-IRC signals: |
205
|
|
|
|
|
|
|
|
206
|
|
|
|
|
|
|
=head2 C (RPL_ISUPPORT or RPL_PROTOCTL) |
207
|
|
|
|
|
|
|
|
208
|
|
|
|
|
|
|
Denotes the capabilities of the server. |
209
|
|
|
|
|
|
|
|
210
|
|
|
|
|
|
|
=head2 C |
211
|
|
|
|
|
|
|
|
212
|
|
|
|
|
|
|
Once the next signal is received that is I than C, |
213
|
|
|
|
|
|
|
it emits an C signal. |
214
|
|
|
|
|
|
|
|
215
|
|
|
|
|
|
|
=head1 OUTPUT EVENTS |
216
|
|
|
|
|
|
|
|
217
|
|
|
|
|
|
|
=head2 C |
218
|
|
|
|
|
|
|
|
219
|
|
|
|
|
|
|
Emitted by: the first signal received after C |
220
|
|
|
|
|
|
|
|
221
|
|
|
|
|
|
|
C will be the plugin object itself for ease of use. |
222
|
|
|
|
|
|
|
|
223
|
|
|
|
|
|
|
This is emitted when the support report has finished. |
224
|
|
|
|
|
|
|
|
225
|
|
|
|
|
|
|
=head1 AUTHOR |
226
|
|
|
|
|
|
|
|
227
|
|
|
|
|
|
|
Jeff C Pinyan, F |
228
|
|
|
|
|
|
|
|
229
|
|
|
|
|
|
|
=head1 SEE ALSO |
230
|
|
|
|
|
|
|
|
231
|
|
|
|
|
|
|
L |
232
|
|
|
|
|
|
|
|
233
|
|
|
|
|
|
|
L |
234
|
|
|
|
|
|
|
|
235
|
|
|
|
|
|
|
=cut |