add RBN filtering
[spider.git] / cmd / show / filter.pl
1 #
2 # show filter commands
3 #
4 # Copyright (c) 2000 Dirk Koopman G1TLH
5 #
6 #
7 #
8 my ($self, $line) = @_;
9 my @f = split /\s+/, $line;
10 my @out;
11 my $call = $self->call;
12
13 if (@f) {
14         if (is_callsign(uc $f[0])) {
15                 return (1, $self->msg('e5')) unless $self->priv >= 1;
16                 $call = uc shift @f;
17     } elsif ($f[0] eq 'node_default' || $f[0] eq 'user_default') {
18                 return (1, $self->msg('e5')) unless $self->priv >= 1;
19                 $call = shift @f;
20         }
21 }
22
23 my @in;
24 if (@f) {
25         push @in, @f;
26 } else {
27         push @in, qw(route ann spots wcy wwv rbn);
28 }
29
30 my $sort;
31 foreach $sort (@in) {
32         my $ref = Filter::read_in($sort, $call, 1);
33         push @out, $ref->print($call, $sort, "input") if $ref;
34         $ref = Filter::read_in($sort, $call, 0);
35         push @out, $ref->print($call, $sort, "") if $ref;
36 }
37 push @out, $self->msg('filter3', $call) unless @out;
38 return (1, @out);