X-Git-Url: http://dxcluster.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=cmd%2Fshow%2Ffilter.pl;h=7fd7923a5093b23f96d87f42e2c795671704de22;hb=b85ee0ca2b03ee2c5be20bd430cfa00757b7ebdb;hp=3b01712a6f78598f0db482142aeb44f288eeefc7;hpb=39e32c88a046b35281a6b1e6e8cf20703b4a9a03;p=spider.git diff --git a/cmd/show/filter.pl b/cmd/show/filter.pl index 3b01712a..7fd7923a 100644 --- a/cmd/show/filter.pl +++ b/cmd/show/filter.pl @@ -8,24 +8,29 @@ my ($self, $line) = @_; my @f = split /\s+/, $line; my @out; -my $dxchan = $self; -my $sort = ''; +my $call = $self->call; -my $f = lc shift @f if @f; -if ($self->priv >= 8) { - my $d = DXChannel->get(uc $f); - $dxchan = $d if $d; - $f = lc shift @f; +if (@f && $self->priv >= 8) { + if (is_callsign(uc $f[0])) { + $call = uc shift @f; + } elsif ($f[0] eq 'node_default' || $f[0] eq 'user_default') { + $call = shift @f; + } } -$sort = $f if $f; -$sort .= 'filter'; +my @in; +if (@f) { + push @in, @f; +} else { + push @in, qw(ann spots wcy wwv); +} my $key; -foreach $key (sort keys %$self) { - if ($key =~ /$sort$/) { - push @out, $self->{$key}->print if $self->{$key}; - } +foreach $key (@in) { + my $ref = Filter::read_in($key, $call, 1); + push @out, $ref->print($call, $key, "input") if $ref; + $ref = Filter::read_in($key, $call, 0); + push @out, $ref->print($call, $key, "") if $ref; } -push @out, $self->msg('filter3', $dxchan->call) unless @out; +push @out, $self->msg('filter3', $call) unless @out; return (1, @out);