… | |
… | |
136 | |
136 | |
137 | return $msg; |
137 | return $msg; |
138 | } |
138 | } |
139 | |
139 | |
140 | |
140 | |
141 | =item B<decode_ctcp_req ($line)> |
141 | =item B<decode_ctcp ($line)> |
|
|
142 | |
|
|
143 | TODO |
142 | |
144 | |
143 | =cut |
145 | =cut |
144 | |
146 | |
145 | sub decode_ctcp { |
147 | sub decode_ctcp { |
146 | my ($line) = @_; |
148 | my ($line) = @_; |
… | |
… | |
152 | $line =~ s/\001[^\001]*\001//g; |
154 | $line =~ s/\001[^\001]*\001//g; |
153 | |
155 | |
154 | return $line; |
156 | return $line; |
155 | } |
157 | } |
156 | |
158 | |
|
|
159 | =item B<filter_ctcp_text_attr ($line, $cb)> |
|
|
160 | |
|
|
161 | TODO |
|
|
162 | |
|
|
163 | =cut |
157 | # implemented after the below CTCP spec, but |
164 | # implemented after the below CTCP spec, but |
158 | # doesnt seem to be used by anyone... so it's untested. |
165 | # doesnt seem to be used by anyone... so it's untested. |
159 | sub filter_ctcp_text_attr { |
166 | sub filter_ctcp_text_attr { |
160 | my ($line, $cb) = @_; |
167 | my ($line, $cb) = @_; |
161 | $cb ||= sub { '' }; |
168 | $cb ||= sub { '' }; |
… | |
… | |
220 | C<$prefix> can also be a hash like it is returned by C<parse_irc_msg>. |
227 | C<$prefix> can also be a hash like it is returned by C<parse_irc_msg>. |
221 | |
228 | |
222 | =cut |
229 | =cut |
223 | |
230 | |
224 | sub prefix_host { |
231 | sub prefix_host { |
225 | my ($self, $prfx) = @_; |
232 | my ($prfx) = @_; |
226 | return (split_prefix ($prfx))[2]; |
233 | return (split_prefix ($prfx))[2]; |
227 | } |
234 | } |
228 | |
235 | |
229 | =back |
|
|
230 | |
236 | |
231 | =item B<rfc_code_to_name ($code)> |
237 | =item B<rfc_code_to_name ($code)> |
232 | |
238 | |
233 | This function is a interface to the internal mapping or numeric |
239 | This function is a interface to the internal mapping or numeric |
234 | replies to the reply name in RFC 2812 (which you may also consult). |
240 | replies to the reply name in RFC 2812 (which you may also consult). |
235 | |
241 | |
236 | C<$code> is returned if no name for C<$code> exists |
242 | C<$code> is returned if no name for C<$code> exists |
237 | (as some server may extended the protocol). |
243 | (as some server may extended the protocol). |
|
|
244 | |
|
|
245 | =back |
238 | |
246 | |
239 | =cut |
247 | =cut |
240 | |
248 | |
241 | our %RFC_NUMCODE_MAP = ( |
249 | our %RFC_NUMCODE_MAP = ( |
242 | '001' => 'RPL_WELCOME', |
250 | '001' => 'RPL_WELCOME', |