fixed sh/c/n
[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
19 return (1, $self->msg('e9')) if !@f;
20
21 my $sort = uc $f[0];
22 my @locals = DXCommandmode->get_all();
23 my $to;
24 my $from = $self->call;
25 my $t = ztime(time);
26 my $tonode;
27 my $sysopflag;
28
29 if ($sort eq "FULL") {
30   $line =~ s/^$f[0]\s+//;    # remove it
31   $to = "ALL";
32 } elsif ($sort eq "SYSOP") {
33   $line =~ s/^$f[0]\s+//;     # remove it
34   @locals = map { $_->priv >= 5 ? $_ : () } @locals;
35   $to = "SYSOP";
36   $sysopflag = '*';
37 } else {
38   $to = "LOCAL";
39 }
40
41 Log('ann', $to, $from, $line);
42 DXProt::broadcast_list("To $to de $from <$t>: $line", @locals);
43 if ($to ne "LOCAL") {
44   $line =~ s/\^//og;    # remove ^ characters!
45   my $pc = DXProt::pc12($from, $line, $tonode, $sysopflag, 0);
46   DXProt::broadcast_ak1a($pc);
47 }
48
49 return (1, ());