X-Git-Url: http://gb7djk.dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;f=cmd%2Fwx.pl;h=025729369a55e2e13f5ca85dddbeb218e94aefb2;hb=0c1082247c57a0ec2fa35a0a81af54b1e6ac2b89;hp=22b5e0ccc262075b1908d6802837a766c520464d;hpb=38e5ac5a541f1bdf1f373d59cc3dcd0c993ae800;p=spider.git diff --git a/cmd/wx.pl b/cmd/wx.pl index 22b5e0cc..02572936 100644 --- a/cmd/wx.pl +++ b/cmd/wx.pl @@ -17,32 +17,52 @@ my ($self, $line) = @_; my @f = split /\s+/, $line; my $sort = uc $f[0]; -my @locals = DXCommandmode->get_all(); my $to; my $from = $self->call; my $t = ztime(time); my $tonode; -my $sysopflag; +my $via; return (1, $self->msg('e5')) if $self->remotecmd || $self->inscript; return (1, $self->msg('e28')) unless $self->registered; if ($sort eq "FULL") { $line =~ s/^$f[0]\s+//; # remove it - $to = "ALL"; -} elsif ($sort eq "SYSOP") { - $line =~ s/^$f[0]\s+//; # remove it - @locals = map { $_->priv >= 5 ? $_ : () } @locals; - $to = "SYSOP"; - $sysopflag = '*'; } else { - $to = "LOCAL"; + $via = "LOCAL"; } +$to = 'WX'; -DXChannel::broadcast_list("WX de $from <$t>: $line", 'wx', undef, @locals); -if ($to ne "LOCAL") { - $line =~ s/\^//og; # remove ^ characters! - my $pc = DXProt::pc12($from, $line, $tonode, $sysopflag, 1); - DXChannel::broadcast_nodes($pc, $main::me); +# if this is a 'bad spotter' user then ignore it +my $nossid = $from; +my $drop = 0; +$nossid =~ s/-\d+$//; +if ($DXProt::badspotter->in($nossid)) { + LogDbg('DXCommand', "bad spotter ($self->{call}) made announcement: $line"); + $drop++; } +# have they sworn? +my @bad; +if (@bad = BadWords::check($line)) { + $self->badcount(($self->badcount||0) + @bad); + LogDbg('DXCommand', "$self->{call} swore: $line (with words:" . join(',', @bad) . ")"); + $drop++; +} + +if ($drop) { + Log('ann', $to, $from, "[to $from only] $line"); + $self->send("WX de $from: $line"); + return (1, ()); +} + +Log('ann', $via ? $via : '*', $from, $line); +$main::me->normal(DXProt::pc93($to, $from, $via, $line)); + +#DXChannel::broadcast_list("WX de $from <$t>: $line", 'wx', undef, @locals); +#if ($to ne "LOCAL") { +# $line =~ s/\^//og; # remove ^ characters! +# my $pc = DXProt::pc12($from, $line, $tonode, $sysopflag, 1); +# DXChannel::broadcast_nodes($pc, $main::me); +#} + return (1, ());