Changeset 971

Show
Ignore:
Timestamp:
10/31/07 22:23:07 (15 months ago)
Author:
tokuhirom
Message:

lang/perl/mobirc: smart handling arguments.

Files:
1 modified

Legend:

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

    r970 r971  
    105105    $channel =~ s/ .*//; 
    106106 
     107    my $canon_channel = canon_name($channel); 
     108 
    107109    my $canon_channel = normalize_channel_name($channel); 
    108110 
     
    131133    # chop off after the gap (bug workaround of POE::Filter::IRC) 
    132134    $channel =~ s/ .*//; 
     135 
     136    my $canon_channel = canon_name($channel); 
    133137 
    134138    my $canon_channel = normalize_channel_name($channel); 
     
    370374} 
    371375 
     376# FIXME: I want more cool implement 
    372377sub _get_args { 
    373378    my $poe = shift; 
    374379 
    375     return map { decode($poe->heap->{config}->{irc}->{incode}, $_) } @{ $poe->args }; 
     380    my @ret; 
     381    for my $elem (@{$poe->args}) { 
     382        if ( ref $elem && ref $elem eq 'ARRAY') { 
     383            push @ret, [map { decode($poe->heap->{config}->{irc}->{incode}, $_) } @$elem]; 
     384        } else { 
     385            push @ret, decode($poe->heap->{config}->{irc}->{incode}, $elem); 
     386        } 
     387    } 
     388    return @ret; 
    376389} 
    377390