X-Git-Url: http://dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;f=cmd%2Fannounce.pl;h=a3ccb5b033d7f98dc8a9044212c40f0c3e38dcdc;hb=9cc26cc7a73efb7679d3e8e819ba0019307f8607;hp=120170399ad6ae17fb1a0f8021b26141e77df62a;hpb=324bd80ed4aef7e2636f5a03288788ce11ab2663;p=spider.git diff --git a/cmd/announce.pl b/cmd/announce.pl index 12017039..a3ccb5b0 100644 --- a/cmd/announce.pl +++ b/cmd/announce.pl @@ -17,8 +17,9 @@ my ($self, $line) = @_; my @f = split /\s+/, $line; - +return (1, $self->msg('e5')) if $self->remotecmd || $self->inscript; return (1, $self->msg('e9')) if !@f; +return (1, $self->msg('e28')) unless $self->registered; my $sort = uc $f[0]; my @locals = DXCommandmode->get_all(); @@ -26,6 +27,7 @@ my $to; my $from = $self->call; my $t = ztime(time); my $tonode; +my $toflag = '*'; my $sysopflag; if ($sort eq "FULL") { @@ -46,12 +48,35 @@ if ($sort eq "FULL") { # change ^ into : for transmission $line =~ s/\^/:/og; +# 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("To $to de $from <$t>: $line"); + return (1, ()); +} + +return (1, $self->msg('dup')) if $self->priv < 5 && AnnTalk::dup($from, $toflag, $line); Log('ann', $to, $from, $line); -DXProt::broadcast_list("To $to de $from <$t>: $line", 'ann', undef, @locals); +DXChannel::broadcast_list("To $to de $from ($t): $line\a", 'ann', undef, @locals); if ($to ne "LOCAL") { - $line =~ s/\^//og; # remove ^ characters! my $pc = DXProt::pc12($from, $line, $tonode, $sysopflag, 0); - DXProt::broadcast_ak1a($pc); + DXChannel::broadcast_nodes($pc); } return (1, ());