Changeset 999

Show
Ignore:
Timestamp:
11/01/07 00:29:35 (6 years ago)
Author:
tokuhirom
Message:

mobirc: DRY.

Location:
lang/perl/mobirc/trunk/mobirc/lib
Files:
3 modified

Legend:

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

    r996 r999  
    6363    my ($self, $hook_point) = @_; 
    6464    die "this is instance method" unless blessed $self; 
    65     return $self->{hooks}->{$hook_point}; 
     65    return $self->{hooks}->{$hook_point} || []; 
    6666} 
    6767 
  • lang/perl/mobirc/trunk/mobirc/lib/Mobirc/HTTPD/Controller.pm

    r998 r999  
    272272    my $content = shift; 
    273273 
    274     for my $code (@{$c->{global_context}->get_hook_codes('html_filter') || []}) { 
     274    for my $code (@{$c->{global_context}->get_hook_codes('html_filter')}) { 
    275275        $content = $code->($c, $content); 
    276276    } 
  • lang/perl/mobirc/trunk/mobirc/lib/Mobirc/IRCClient.pm

    r997 r999  
    185185    DEBUG "IRC NOTICE"; 
    186186 
    187     for my $code (@{ $poe->heap->{global_context}->get_hook_codes('on_irc_notice') || [] }) { 
     187    for my $code (@{ $poe->heap->{global_context}->get_hook_codes('on_irc_notice') }) { 
    188188        my $finished = $code->($poe, $who, $channel, $msg); 
    189189        return if $finished;