d2a59bc07131195176775adb74fe693d045efe98
[spider.git] / cmd / clear / spots.pl
1 #
2 # clear filters commands
3 #
4 # Copyright (c) 2000 Dirk Koopman G1TLH
5 #
6 # $Id$
7 #
8 my ($self, $line) = @_;
9 my @f = split(/\s+/, $line);
10 my @out;
11 my $dxchan = $self;
12 my $sort = 'spots';
13 my $flag;
14 my $fno = 1;
15 my $call = $dxchan->call;
16 my $f;
17
18 if ($self->priv >= 8) {
19         if (is_callsign(uc $f[0])) {
20                 $f = uc shift @f;
21                 my $uref = DXUser->get($f);
22                 $call = $uref->call if $uref;
23         }
24         if ($f[0] eq 'input') {
25                 shift @f;
26                 $flag = 'in';
27         }
28 }
29
30 $fno = shift @f if @f && $f[0] =~ /^\d$/;
31
32 my $filter = Filter::read_in($sort, $call, $flag);
33 Filter::delete($sort, $call, $flag, $fno);
34 $flag = $flag ? "input " : "";
35 push @out, $self->msg('filter4', $flag, $sort, $fno, $call);
36 return (1, @out);