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