| 9 | | |
| 10 | | { |
| 11 | | # HACK HACK HACK |
| 12 | | # POE::Filter::IRC::Compat->get_one returns undef when invalid CTCP request. |
| 13 | | # POE::Filter::Stackable dies when get the undef! |
| 14 | | # see also http://rt.cpan.org/Ticket/Display.html?id=38773 |
| 15 | | my $meta = Class::MOP::Class->initialize('POE::Filter::IRC::Compat') or die "cannot get meta class of the POE::Filter::IRC::Compat"; |
| 16 | | $meta->add_around_method_modifier('get_one', sub { |
| 17 | | my ($next, @args) = @_; |
| 18 | | my $result = $next->(@args); |
| 19 | | $result ? $result : []; |
| 20 | | }); |
| 21 | | $meta->make_immutable; |
| 22 | | } |