X-Git-Url: http://www.dxcluster.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=cmd%2Fwx.pl;h=571471909fac9677a1010a2afd6ba1f0dd8a9730;hb=4b207544da78b182bd12e94eab01451694749012;hp=af7cd0abd785a65ba6f14dc1c4204e981a5500bb;hpb=50f6466ca2dff82ca470a4abe327d741cffef61a;p=spider.git diff --git a/cmd/wx.pl b/cmd/wx.pl index af7cd0ab..57147190 100644 --- a/cmd/wx.pl +++ b/cmd/wx.pl @@ -11,36 +11,58 @@ # # Copyright (c) 1998 Dirk Koopman G1TLH # -# $Id$ +# # 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->isregistered; 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'; + +# 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++; } -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); +# 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, ());