+ my $t = $_[2];
+ my $parent = check_pc9x_t($pcall, $t, 93, 1) || return;
+
+ my $to = uc $_[3];
+ my $from = uc $_[4];
+ my $via = uc $_[5];
+ my $text = $_[6];
+ my $onode = uc $_[7];
+ $onode = $pcall if @_ <= 8;
+
+ # this is catch loops caused by bad software ...
+ if (eph_dup("PC93|$from|$text|$onode", $pc10_dupe_age)) {
+ return;
+ }
+
+ # will we allow it at all?
+ if ($censorpc) {
+ my @bad;
+ if (@bad = BadWords::check($text)) {
+ dbg("PCPROT: Bad words: @bad, dropped") if isdbg('chanerr');
+ return;
+ }
+ }
+
+ # 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;
+ }
+
+ # if it is routeable then then treat it like a talk
+ my $ref = Route::get($to);
+ if ($ref) {
+ # local talks
+ my $dxchan;
+ $dxchan = DXChannel::get($main::myalias) if $to eq $main::mycall;
+ $dxchan = DXChannel::get($to) unless $dxchan;
+ # check it...
+ if ($dxchan) {
+ if (ref $dxchan && $dxchan->isa('DXChannel')) {
+ if ($dxchan->is_user) {
+ $dxchan->talk($from, $to, $via, $text, $onode);
+ return;
+ }
+ } else {
+ dbg("ERROR: $to -> $dxchan is not a DXChannel! (local talk)");
+ }
+ }
+
+ # convert to PC10 talks where appropriate
+ if ($ref) {
+ # just go for the "best" one for now (rather than broadcast)
+ $dxchan = $ref->dxchan;
+
+ # check it...
+ 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;
+ }
+
+ # otherwise, drop through and allow it to be broadcast
+ } 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 to non-pc9x nodes
+ $self->send_chat(1, pc12($from, $text, undef, $to, undef, $pcall), $from, '*', $text, $to, $pcall, '0');
+ }