added announce
[spider.git] / cmd / announce.pl
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..cb2e325dff6c8c6e62811e276ae8fe913a59345b 100644 (file)
@@ -0,0 +1,45 @@
+#
+# 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";
+}
+
+DXProt::broadcast_list("To $to de $from <$t>: $line", @locals);
+if ($to ne "LOCAL") {
+  $line =~ s/\^//og;    # remove ^ characters!
+  my $pc = DXProt::pc12($self, $line, $tonode, $sysopflag, 0);
+  DXProt::broadcast_ak1a($pc);
+}
+
+return (1, ());