… | |
… | |
164 | =cut |
164 | =cut |
165 | # implemented after the below CTCP spec, but |
165 | # implemented after the below CTCP spec, but |
166 | # doesnt seem to be used by anyone... so it's untested. |
166 | # doesnt seem to be used by anyone... so it's untested. |
167 | sub filter_ctcp_text_attr { |
167 | sub filter_ctcp_text_attr { |
168 | my ($line, $cb) = @_; |
168 | my ($line, $cb) = @_; |
169 | $cb ||= sub { '' }; |
169 | return unless $cb; |
170 | $line =~ s/\006([BVUSI])/{warn "FIL\n"; my $c = $cb->($1); defined $c ? $c : "\006$1"}/ieg; |
170 | $line =~ s/\006([BVUSI])/{warn "FIL\n"; my $c = $cb->($1); defined $c ? $c : "\006$1"}/ieg; |
171 | $line =~ s/\006CA((?:I[0-9A-F]|#[0-9A-F]{3}){2})/{my $c = $cb->($1); defined $c ? $c : "\006CA$1"}/ieg; |
171 | $line =~ s/\006CA((?:I[0-9A-F]|#[0-9A-F]{3}){2})/{my $c = $cb->($1); defined $c ? $c : "\006CA$1"}/ieg; |
172 | $line =~ s/\006C([FB])(I[0-9A-F]|#[0-9A-F]{3})/{my $c = $cb->($1, $2); defined $c ? $c : "\006C$1$2"}/ieg; |
172 | $line =~ s/\006C([FB])(I[0-9A-F]|#[0-9A-F]{3})/{my $c = $cb->($1, $2); defined $c ? $c : "\006C$1$2"}/ieg; |
173 | $line =~ s/\006CX([AFB])/{my $c = $cb->($1); defined $c ? $c : "\006CX$1"}/ieg; |
173 | $line =~ s/\006CX([AFB])/{my $c = $cb->($1); defined $c ? $c : "\006CX$1"}/ieg; |
174 | return $line; |
174 | return $line; |