X-Git-Url: https://ruin.nu/git/?p=NDIRC.git;a=blobdiff_plain;f=Dispatcher.pm;h=a11ae53cda91800f387dcd4fae40c874a2a9b045;hp=76beef574c6687127d2fe3cb1bcc05501d4c40dd;hb=c9c9e83da024d15fc1245bf456c197c119f23cf4;hpb=4c84eb6e64b730b9b8726d30e70c355a5056b83c diff --git a/Dispatcher.pm b/Dispatcher.pm index 76beef5..a11ae53 100644 --- a/Dispatcher.pm +++ b/Dispatcher.pm @@ -87,6 +87,7 @@ sub add_channel { my ($self,$channel,$types) = @_; $types = Set::Object->new(@{$types}); + $types->insert('universal'); $self->channels->{lc $channel} = $types; } @@ -96,9 +97,10 @@ sub has_command { return 0 unless defined $command && defined $channel; return 0 unless exists $self->commands->{$command}; + $command = $self->commands->{$command}; + return 1 if $command->type eq 'universal'; return 0 unless exists $self->channels->{$channel}; - $command = $self->commands->{$command}; return $self->channels->{$channel}->has($command->type); }