Changes in / [e1e59a7:69c3878]
- Location:
- perl/modules/IRC/lib/BarnOwl/Module
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
perl/modules/IRC/lib/BarnOwl/Module/IRC.pm
r0c4a190 r0c4a190 545 545 $conn = get_connection_by_alias($alias); 546 546 } 547 if( !$conn &&$use_channel) {547 if($use_channel) { 548 548 $channel = $ARGV[0]; 549 549 if(defined($channel) && $channel =~ /^#/) { 550 550 if($channels{$channel} && @{$channels{$channel}} == 1) { 551 551 shift @ARGV; 552 $conn = $channels{$channel}[0]; 553 } 552 $conn = $channels{$channel}[0] unless $conn; 553 } 554 } elsif ($m && $m->type eq 'IRC' && !$m->is_private) { 555 $channel = $m->channel; 554 556 } else { 555 if($m && $m->type eq 'IRC' && !$m->is_private) { 556 $channel = $m->channel; 557 } else { 558 undef $channel; 559 } 557 undef $channel; 560 558 } 561 559 } 560 562 561 if(!$channel && $use_channel == REQUIRE_CHANNEL) { 563 562 die("Usage: $cmd <channel>\n"); -
perl/modules/IRC/lib/BarnOwl/Module/IRC/Connection.pm
r744769e r7cfb1df 74 74 $self->conn->add_handler(endofwhois=> sub { shift; $self->on_endofwhois(@_) }); 75 75 $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(@_) }); 79 77 80 78 return $self; … … 204 202 my $self = shift; 205 203 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 } 206 212 BarnOwl::remove_dispatch($self->{FD}); 207 213 BarnOwl::admin_message('IRC', … … 282 288 join(" ", $evt->args) . "on " . $evt->to->[0] 283 289 ); 290 } 291 292 sub on_nosuchchannel { 293 my ($self, $evt) = @_; 294 BarnOwl::admin_message("IRC", 295 "[" . $self->alias . "] " . 296 "No such channel: " . [$evt->args]->[1]) 284 297 } 285 298
Note: See TracChangeset
for help on using the changeset viewer.