started the addition of help files
[spider.git] / cmd / announce.pl
1 #
2 # do an announce message 
3 #
4 # handles announce
5 #         announce full
6 #         announce sysop
7 #
8 # at the moment these keywords are fixed, but I dare say a file containing valid ones
9 # will appear
10 #
11 # Copyright (c) 1998 Dirk Koopman G1TLH
12 #
13 # $Id$
14 #
15
16 my ($self, $line) = @_;
17 my @f = split /\s+/, $line;
18 my $sort = uc $f[0];
19 my @locals = DXCommandmode->get_all();
20 my $to;
21 my $from = $self->call;
22 my $t = ztime(time);
23 my $tonode;
24 my $sysopflag;
25
26 if ($sort eq "FULL") {
27   $line =~ s/^$f[0]\s+//;    # remove it
28   $to = "ALL";
29 } elsif ($sort eq "SYSOP") {
30   $line =~ s/^$f[0]\s+//;     # remove it
31   @locals = map { $_->priv >= 5 ? $_ : () } @locals;
32   $to = "SYSOP";
33   $sysopflag = '*';
34 } else {
35   $to = "LOCAL";
36 }
37
38 DXProt::broadcast_list("To $to de $from <$t>: $line", @locals);
39 if ($to ne "LOCAL") {
40   $line =~ s/\^//og;    # remove ^ characters!
41   my $pc = DXProt::pc12($from, $line, $tonode, $sysopflag, 0);
42   DXProt::broadcast_ak1a($pc);
43 }
44
45 return (1, ());