]> ruin.nu Git - NDIRC.git/blobdiff - Dispatcher.pm
Universal scan parsing
[NDIRC.git] / Dispatcher.pm
index 76beef574c6687127d2fe3cb1bcc05501d4c40dd..a11ae53cda91800f387dcd4fae40c874a2a9b045 100644 (file)
@@ -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);
 }