X-Git-Url: http://dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;f=cmd%2Fannounce.pl;h=6bad4af39449d256c7c023751e9c803181dc8c8b;hb=17b961e3ee4a9f2d0ff2cc7f5b0e8546816f9f64;hp=cb2e325dff6c8c6e62811e276ae8fe913a59345b;hpb=0824a94355e5fb2b4c379bb013d66466725629f5;p=spider.git diff --git a/cmd/announce.pl b/cmd/announce.pl index cb2e325d..6bad4af3 100644 --- a/cmd/announce.pl +++ b/cmd/announce.pl @@ -12,15 +12,22 @@ # # $Id$ # +# Modified 13Dec98 Iain Phillips G0RDI +# 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(); my $to; my $from = $self->call; my $t = ztime(time); my $tonode; +my $toflag = '*'; my $sysopflag; if ($sort eq "FULL") { @@ -31,15 +38,45 @@ if ($sort eq "FULL") { @locals = map { $_->priv >= 5 ? $_ : () } @locals; $to = "SYSOP"; $sysopflag = '*'; +} elsif ($sort eq "LOCAL") { + $line =~ s/^$f[0]\s+//; # remove it + $to = "LOCAL"; } else { $to = "LOCAL"; } -DXProt::broadcast_list("To $to de $from <$t>: $line", @locals); +# 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 ($from) 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); +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($self, $line, $tonode, $sysopflag, 0); - DXProt::broadcast_ak1a($pc); + my $pc = DXProt::pc12($from, $line, $tonode, $sysopflag, 0); + DXChannel::broadcast_nodes($pc); } return (1, ());