Changeset 18380 for lang

Show
Ignore:
Timestamp:
08/28/08 13:37:48 (3 months ago)
Author:
tokuhirom
Message:

quick hack for fixing POE::Filter::IRC's bug.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • lang/perl/mobirc/trunk/lib/App/Mobirc/Plugin/Component/IRCClient.pm

    r13628 r18380  
    66use POE::Sugar::Args; 
    77use POE::Component::IRC; 
     8use POE::Filter::IRC::Compat; 
     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    my $meta = Class::MOP::Class->initialize('POE::Filter::IRC::Compat') or die "cannot get meta class of the POE::Filter::IRC::Compat"; 
     15    $meta->add_around_method_modifier('get_one', sub { 
     16        my ($next, @args) = @_; 
     17        my $result = $next->(@args); 
     18        $result ? $result : []; 
     19    }); 
     20    $meta->make_immutable; 
     21} 
    822 
    923use Encode;