The new BadWord, all regex, system
[spider.git] / cmd / unset / badword.pl
1 #
2 # unset list of bad dx callsigns
3 #
4 # Copyright (c) 1998 - Dirk Koopman G1TLH
5 #
6 #
7 #
8 my ($self, $line) = @_;
9 return (1, $self->msg('e5')) if $self->remotecmd;
10 # are we permitted?
11 return (1, $self->msg('e5')) if $self->priv < 6;
12
13 my @words = split /\s+/, uc $line;
14 my @out;
15 my $count = 0;
16 foreach my $w (@words) {
17         my @in;
18         
19         unless (@in = BadWords::check($w)) {
20                 push @out, "BadWord $w not defined, ignored";
21         } else {
22                 @in = BadWords::del_regex($w);
23                 push @out, "BadWord $w removed";
24                 $count++;
25         }
26 }
27 if ($count) {
28         BadWords::generate_regex();
29         BadWords::put();
30 }
31 return (1, @out);
32