Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • perl/modules/IRC/lib/BarnOwl/Module/IRC/Connection.pm

    r744769e r7cfb1df  
    7474    $self->conn->add_handler(endofwhois=> sub { shift; $self->on_endofwhois(@_) });
    7575    $self->conn->add_handler(mode      => sub { shift; $self->on_mode(@_) });
    76 
    77     # * nosuchchannel
    78     # *
     76    $self->conn->add_handler(nosuchchannel => sub { shift; $self->on_nosuchchannel(@_) });
    7977
    8078    return $self;
     
    204202    my $self = shift;
    205203    delete $BarnOwl::Module::IRC::ircnets{$self->alias};
     204    for my $k (keys %BarnOwl::Module::IRC::channels) {
     205        my @conns = grep {$_ ne $self} @{$BarnOwl::Module::IRC::channels{$k}};
     206        if(@conns) {
     207            $BarnOwl::Module::IRC::channels{$k} = \@conns;
     208        } else {
     209            delete $BarnOwl::Module::IRC::channels{$k};
     210        }
     211    }
    206212    BarnOwl::remove_dispatch($self->{FD});
    207213    BarnOwl::admin_message('IRC',
     
    282288                           join(" ", $evt->args) . "on " . $evt->to->[0]
    283289                          );
     290}
     291
     292sub on_nosuchchannel {
     293    my ($self, $evt) = @_;
     294    BarnOwl::admin_message("IRC",
     295                           "[" . $self->alias . "] " .
     296                           "No such channel: " . [$evt->args]->[1])
    284297}
    285298
Note: See TracChangeset for help on using the changeset viewer.