- $self->broadcast_route_pc9x($pcall, undef, $line, 0);
- foreach my $r (@rdel) {
- next unless $r;
-
- $self->route_pc21($pcall, undef, $r) if $r->isa('Route::Node');
- $self->route_pc17($pcall, undef, $parent, $r) if $r->isa('Route::User');
- }
- my @pc19 = grep { $_ && $_->isa('Route::Node') } @radd;
- my @pc16 = grep { $_ && $_->isa('Route::User') } @radd;
- $self->route_pc19($pcall, undef, @pc19) if @pc19;
- $self->route_pc16($pcall, undef, $parent, @pc16) if @pc16;
+ # 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) {
+ # 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
+ # 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;
+
+ } 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');
+ }
+
+ # 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';