X-Git-Url: http://gb7djk.dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;f=cmd%2Fannounce.pl;h=f9d3fc4b285b8640c0cf04100ba49600634de184;hb=cce345b95c555a0b45218c5b452bc0f5f4f13bab;hp=e69de29bb2d1d6434b8b29ae775ad8c2e48c5391;hpb=6b6a8002929017b6d4217f68fa492a2d728ee1fe;p=spider.git diff --git a/cmd/announce.pl b/cmd/announce.pl index e69de29b..f9d3fc4b 100644 --- a/cmd/announce.pl +++ b/cmd/announce.pl @@ -0,0 +1,46 @@ +# +# 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 +# +# $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; + +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"; +} + +Log('ann', $to, $from, $line); +DXProt::broadcast_list("To $to de $from <$t>: $line", @locals); +if ($to ne "LOCAL") { + $line =~ s/\^//og; # remove ^ characters! + my $pc = DXProt::pc12($from, $line, $tonode, $sysopflag, 0); + DXProt::broadcast_ak1a($pc); +} + +return (1, ());