+
+ # if this is a 'bad spotter' user then ignore it
+ my $nossid = $from;
+ $nossid =~ s/-\d+$//;
+ if ($badspotter->in($nossid)) {
+ dbg("PCPROT: Bad Spotter, dropped") if isdbg('chanerr');
+ return;
+ }
+
+ # ignore PC93 coming in from outside this node with a target of local
+ if ($to eq 'LOCAL' && $self != $main::me) {
+ dbg("PCPROT: incoming LOCAL chat not from local node, ignored") if isdbg('chanerr');
+ return;
+ }
+
+ # if it is routeable then then treat it like a talk
+ my $ref = Route::get($to);
+ if ($ref) {
+ my $dxchan;
+
+ # convert to PC10 or local talks where appropriate
+ # PC93 capable nodes of the same hop count all get a copy
+ # if there is a PC10 node then it will get a copy and that
+ # will be it. Hopefully such a node will not figure highly
+ # in the route list, unless it is local, 'cos it don't issue PC92s!
+ # note that both local and PC93s at the same time are possible if the
+ # user on more than one node.
+ my @routes = find_pc9x_routes($to);
+ my $lasthops;
+ foreach $dxchan (@routes) {
+ if (ref $dxchan && $dxchan->isa('DXChannel')) {
+ if ($dxchan->{do_pc9x}) {
+ $dxchan->send($line);
+ } else {
+ $dxchan->talk($from, $to, $via, $text, $onode);
+ }
+ } else {
+ dbg("ERROR: $to -> $dxchan is not a DXChannel! (convert to pc10)");
+ }
+ }
+ return;
+
+ } elsif ($to eq '*' || $to eq 'SYSOP' || $to eq 'WX') {
+ # announces
+ my $sysop = $to eq 'SYSOP' ? '*' : ' ';
+ my $wx = $to eq 'WX' ? '1' : '0';
+ my $local = $via eq 'LOCAL' ? '*' : $via;
+
+ $self->send_announce(1, pc12($from, $text, $local, $sysop, $wx, $pcall), $from, $local, $text, $sysop, $pcall, $wx, $via eq 'LOCAL' ? $via : undef);
+ return if $via eq 'LOCAL';
+ } elsif (!is_callsign($to) && $text =~ /^#\d+ /) {
+ # chat messages really only locally connected users
+ $self->send_chat(1, $line, $from, '*', $text, $to, $pcall, '0');
+ }
+
+ # broadcast this chat sentence everywhere unless it is targetted to 'LOCAL'
+ $self->broadcast_route_pc9x($pcall, undef, $line, 0) unless $to eq 'LOCAL' || $via eq 'LOCAL';