return (1, $self->msg('e28')) unless $self->registered;
my $sort = uc $f[0];
-my @locals = DXCommandmode->get_all();
-my $to;
+my $to = '*';
my $from = $self->call;
my $t = ztime(time);
my $tonode;
my $toflag = '*';
my $sysopflag;
+my $via = 'LOCAL';
if ($sort eq "FULL") {
$line =~ s/^$f[0]\s+//; # remove it
- $to = "ALL";
+ $via = $to = "*";
} elsif ($sort eq "SYSOP") {
$line =~ s/^$f[0]\s+//; # remove it
- @locals = map { $_->priv >= 5 ? $_ : () } @locals;
$to = "SYSOP";
- $sysopflag = '*';
+ $via = $sysopflag = '*';
} elsif ($sort eq "LOCAL") {
$line =~ s/^$f[0]\s+//; # remove it
- $to = "LOCAL";
-} else {
- $to = "LOCAL";
}
-# change ^ into : for transmission
-$line =~ s/\^/:/og;
-
# if this is a 'bad spotter' user then ignore it
my $nossid = $from;
my $drop = 0;
if ($drop) {
Log('ann', $to, $from, "[to $from only] $line");
- $self->send("To $to de $from <$t>: $line");
+ $self->send("To $to de $from: $line");
return (1, ());
}
return (1, $self->msg('dup')) if $self->priv < 5 && AnnTalk::dup($from, $toflag, $line);
Log('ann', $to, $from, $line);
-DXChannel::broadcast_list("To $to de $from ($t): $line\a", 'ann', undef, @locals);
-if ($to ne "LOCAL") {
- my $pc = DXProt::pc12($from, $line, $tonode, $sysopflag, 0);
- DXChannel::broadcast_nodes($pc);
-}
+$main::me->normal(DXProt::pc93($to, $from, $via, $line));
+
+#DXChannel::broadcast_list("To $to de $from ($t): $line\a", 'ann', undef, @locals);
+#if ($to ne "LOCAL") {
+# my $pc = DXProt::pc12($from, $line, $tonode, $sysopflag, 0);
+# DXChannel::broadcast_nodes($pc);
+#}
return (1, ());
my $msgid = DXProt::nextchatmsgid();
$text = "#$msgid $text";
-DXProt::send_chat($self, DXProt::pc12($from, $text, '*', $target), $from, '*', $text, $target, $main::mycall, '0');
+$main::me->normal(DXProt::pc93($to, $from, undef, $text));
+
+#DXProt:):send_chat($self, 1, DXProt::pc12($from, $text, '*', $target), $from, '*', $text, $target, $main::mycall, '0');
return (1, ());
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;
+my $via;
return (1, $self->msg('e5')) if $self->remotecmd || $self->inscript;
return (1, $self->msg('e28')) unless $self->registered;
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";
+ $via = "LOCAL";
}
+$to = 'WX';
-DXChannel::broadcast_list("WX de $from <$t>: $line", 'wx', undef, @locals);
-if ($to ne "LOCAL") {
- $line =~ s/\^//og; # remove ^ characters!
- my $pc = DXProt::pc12($from, $line, $tonode, $sysopflag, 1);
- DXChannel::broadcast_nodes($pc, $main::me);
+# if this is a 'bad spotter' user then ignore it
+my $nossid = $from;
+my $drop = 0;
+$nossid =~ s/-\d+$//;
+if ($DXProt::badspotter->in($nossid)) {
+ LogDbg('DXCommand', "bad spotter ($self->{call}) made announcement: $line");
+ $drop++;
}
+# have they sworn?
+my @bad;
+if (@bad = BadWords::check($line)) {
+ $self->badcount(($self->badcount||0) + @bad);
+ LogDbg('DXCommand', "$self->{call} swore: $line (with words:" . join(',', @bad) . ")");
+ $drop++;
+}
+
+if ($drop) {
+ Log('ann', $to, $from, "[to $from only] $line");
+ $self->send("WX de $from: $line");
+ return (1, ());
+}
+
+Log('ann', $via ? $via : '*', $from, $line);
+$main::me->normal(DXProt::pc93($to, $from, $via, $line));
+
+#DXChannel::broadcast_list("WX de $from <$t>: $line", 'wx', undef, @locals);
+#if ($to ne "LOCAL") {
+# $line =~ s/\^//og; # remove ^ characters!
+# my $pc = DXProt::pc12($from, $line, $tonode, $sysopflag, 1);
+# DXChannel::broadcast_nodes($pc, $main::me);
+#}
+
return (1, ());
sub send_announce
{
my $self = shift;
+ my $from_pc9x = shift;
my $line = shift;
my @dxchan = DXChannel::get_all();
my $dxchan;
- my $target;
+ my $target = $_[6];
my $to = 'To ';
my $text = unpad($_[2]);
} elsif ($_[3] gt ' ') { # speciality list handling
my ($name) = split /\./, $_[3];
$target = "$name"; # put the rest in later (if bothered)
- }
+ }
if ($_[5] eq '1') {
$target = "WX";
foreach $dxchan (@dxchan) {
next if $dxchan == $main::me;
next if $dxchan == $self && $self->is_node;
+ next if $from_pc9x && $dxchan->{do_pc9x};
+ next if $target eq 'LOCAL' && $dxchan->is_node;
$dxchan->announce($line, $self->{isolate}, $to, $target, $text, @_, $self->{call},
@a[0..2], @b[0..2]);
}
sub send_chat
{
my $self = shift;
+ my $from_pc9x = shift;
my $line = shift;
my @dxchan = DXChannel::get_all();
my $dxchan;
if ($dxchan->is_node) {
next if $dxchan == $main::me;
next if $dxchan == $self;
+ next if $from_pc9x && $dxchan->{do_pc9x};
next unless $dxchan->is_spider || $is_ak1a;
next if $target eq 'LOCAL';
if (!$ak1a_line && $is_ak1a) {
- $ak1a_line = DXProt::pc12($_[0], $text, $_[1], "$target.LST");
+ $ak1a_line = pc12($_[0], $text, $_[1], "$target.LST");
}
}
my $dxchan;
if ((($dxchan = DXChannel::get($_[2])) && $dxchan->is_user) || $_[4] =~ /^[\#\w.]+$/){
- $self->send_chat($line, @_[1..6]);
+ $self->send_chat(0, $line, @_[1..6]);
} elsif ($_[2] eq '*' || $_[2] eq $main::mycall) {
# remember a route
}
# send it
- $self->send_announce($line, @_[1..6]);
+ $self->send_announce(0, $line, @_[1..6]);
} else {
$self->route($_[2], $line);
}
}
# otherwise, drop through and allow it to be broadcast
- } elsif ($to eq '*' || $to eq 'SYSOP' || $to eq 'WX') {
+ } elsif ($to eq '*' || uc $to eq 'SYSOP' || uc $to eq 'WX') {
# announces
+ my $sysop = uc $to eq 'SYSOP' ? '*' : ' ';
+ my $wx = uc $to eq 'WX' ? '1' : '0';
+ my $local = $via eq 'LOCAL' ? '*' : $via;
+
+ $self->send_announce(1, pc12($from, $text, $local, $via, $sysop, $wx, $pcall), $from, $local, $text, $sysop, $pcall, $wx, $via eq 'LOCAL' ? $via : undef);
+ return if $via eq 'LOCAL';
} else {
- # chat messages
+ # chat messages to non-pc9x nodes
+ $self->send_chat(1, pc12($from, $text, undef, $to, undef, $pcall), $from, '*', $text, $to, $pcall, '0');
}
$self->broadcast_route_pc9x($pcall, undef, $line, 0);
}