1998-09-28 15:32:01 +00:00
|
|
|
#
|
|
|
|
# do an announce message
|
|
|
|
#
|
|
|
|
# handles announce
|
|
|
|
# announce full
|
|
|
|
# announce sysop
|
|
|
|
#
|
|
|
|
# at the moment these keywords are fixed, but I dare say a file containing valid ones
|
|
|
|
# will appear
|
|
|
|
#
|
|
|
|
# Copyright (c) 1998 Dirk Koopman G1TLH
|
|
|
|
#
|
2007-07-11 15:41:51 +00:00
|
|
|
#
|
1998-09-28 15:32:01 +00:00
|
|
|
#
|
1998-12-13 22:38:04 +00:00
|
|
|
# Modified 13Dec98 Iain Phillips G0RDI
|
|
|
|
#
|
1998-09-28 15:32:01 +00:00
|
|
|
|
|
|
|
my ($self, $line) = @_;
|
2007-06-25 17:04:59 +00:00
|
|
|
#$DB::single = 1;
|
1998-09-28 15:32:01 +00:00
|
|
|
my @f = split /\s+/, $line;
|
2005-01-15 22:03:46 +00:00
|
|
|
return (1, $self->msg('e5')) if $self->remotecmd || $self->inscript;
|
1998-12-03 23:35:58 +00:00
|
|
|
return (1, $self->msg('e9')) if !@f;
|
2001-10-24 20:47:07 +00:00
|
|
|
return (1, $self->msg('e28')) unless $self->registered;
|
1998-12-03 23:35:58 +00:00
|
|
|
|
1998-09-28 15:32:01 +00:00
|
|
|
my $sort = uc $f[0];
|
2007-01-23 22:41:40 +00:00
|
|
|
my $to = '*';
|
1998-09-28 15:32:01 +00:00
|
|
|
my $from = $self->call;
|
|
|
|
my $t = ztime(time);
|
|
|
|
my $tonode;
|
2000-11-29 23:17:19 +00:00
|
|
|
my $toflag = '*';
|
1998-09-28 15:32:01 +00:00
|
|
|
my $sysopflag;
|
2007-01-23 22:41:40 +00:00
|
|
|
my $via = 'LOCAL';
|
1998-09-28 15:32:01 +00:00
|
|
|
|
|
|
|
if ($sort eq "FULL") {
|
|
|
|
$line =~ s/^$f[0]\s+//; # remove it
|
2007-01-23 22:41:40 +00:00
|
|
|
$via = $to = "*";
|
1998-09-28 15:32:01 +00:00
|
|
|
} elsif ($sort eq "SYSOP") {
|
|
|
|
$line =~ s/^$f[0]\s+//; # remove it
|
2000-12-05 15:41:36 +00:00
|
|
|
$to = "SYSOP";
|
2007-01-23 22:41:40 +00:00
|
|
|
$via = $sysopflag = '*';
|
1998-12-13 22:38:04 +00:00
|
|
|
} elsif ($sort eq "LOCAL") {
|
|
|
|
$line =~ s/^$f[0]\s+//; # remove it
|
1998-09-28 15:32:01 +00:00
|
|
|
}
|
|
|
|
|
2006-01-11 20:21:50 +00:00
|
|
|
# if this is a 'bad spotter' user then ignore it
|
|
|
|
my $nossid = $from;
|
|
|
|
my $drop = 0;
|
|
|
|
$nossid =~ s/-\d+$//;
|
|
|
|
if ($DXProt::badspotter->in($nossid)) {
|
2006-01-15 19:52:58 +00:00
|
|
|
LogDbg('DXCommand', "bad spotter ($self->{call}) made announcement: $line");
|
2006-01-11 20:21:50 +00:00
|
|
|
$drop++;
|
|
|
|
}
|
|
|
|
|
|
|
|
# have they sworn?
|
2000-09-02 15:28:14 +00:00
|
|
|
my @bad;
|
|
|
|
if (@bad = BadWords::check($line)) {
|
2001-10-01 23:18:50 +00:00
|
|
|
$self->badcount(($self->badcount||0) + @bad);
|
2006-01-07 16:53:03 +00:00
|
|
|
LogDbg('DXCommand', "$self->{call} swore: $line (with words:" . join(',', @bad) . ")");
|
2006-01-11 20:21:50 +00:00
|
|
|
$drop++;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ($drop) {
|
2001-10-09 14:03:31 +00:00
|
|
|
Log('ann', $to, $from, "[to $from only] $line");
|
2007-01-23 22:41:40 +00:00
|
|
|
$self->send("To $to de $from: $line");
|
2001-10-09 14:03:31 +00:00
|
|
|
return (1, ());
|
2000-09-02 15:28:14 +00:00
|
|
|
}
|
|
|
|
|
2007-06-25 17:04:59 +00:00
|
|
|
#return (1, $self->msg('dup')) if $self->priv < 5 && AnnTalk::dup($from, $toflag, $line);
|
1998-11-29 15:14:48 +00:00
|
|
|
Log('ann', $to, $from, $line);
|
2007-01-23 22:41:40 +00:00
|
|
|
$main::me->normal(DXProt::pc93($to, $from, $via, $line));
|
|
|
|
|
|
|
|
#DXChannel::broadcast_list("To $to de $from ($t): $line\a", 'ann', undef, @locals);
|
|
|
|
#if ($to ne "LOCAL") {
|
|
|
|
# my $pc = DXProt::pc12($from, $line, $tonode, $sysopflag, 0);
|
|
|
|
# DXChannel::broadcast_nodes($pc);
|
|
|
|
#}
|
1998-09-28 15:32:01 +00:00
|
|
|
|
|
|
|
return (1, ());
|