X-Git-Url: https://ruin.nu/git/?p=NDIRC.git;a=blobdiff_plain;f=Dispatcher.pm;h=76beef574c6687127d2fe3cb1bcc05501d4c40dd;hp=107ed7eaa778fc962f44281a667317c984cd32ac;hb=8d103256e7f29d892d040ec25a38b2cb56e7f942;hpb=52aa24ac076b97096ff29e7a59331654620f230c diff --git a/Dispatcher.pm b/Dispatcher.pm index 107ed7e..76beef5 100644 --- a/Dispatcher.pm +++ b/Dispatcher.pm @@ -46,11 +46,6 @@ has channels => ( default => sub{ {} }, ); -has targets => ( - is => 'ro', - isa => 'HashRef[Str]', - default => sub{ {} }, -); my $DISP; @@ -68,6 +63,7 @@ sub load { warn "couldn't run $file" unless $return; } } + $DISP = undef; } sub command ($$$) { @@ -98,6 +94,7 @@ sub has_command { my ($self,$command,$channel) = @_; $channel = lc $channel; + return 0 unless defined $command && defined $channel; return 0 unless exists $self->commands->{$command}; return 0 unless exists $self->channels->{$channel}; @@ -105,11 +102,6 @@ sub has_command { return $self->channels->{$channel}->has($command->type); } -sub set_target { - my ($self,$label,$target) = @_; - $self->targets->{$label} = $target; -} - sub run_command { my ($self,$c,$command,$args) = @_;