Allow PC10s to be converted to PC93 and be processed
[spider.git] / perl / DXProtHandle.pm
index b58f95bf2f7e2f0e7bdd86b6f12670f27d6248da..fed2cbeea1efad9eb25675aa209090fba341f19d 100644 (file)
@@ -106,8 +106,8 @@ sub handle_10
        RouteDB::update($_[6], $self->{call});
 #      RouteDB::update($to, $_[6]);
 
-       # convert this to a PC93 and process it as such
-       $self->normal(pc93($to, $from, $via, $_[3], $_[6]));
+       # convert this to a PC93, coming from mycall with origin set and process it as such
+       $main::me->normal(pc93($to, $from, $via, $_[3], $_[6]));
 }
 
 # DX Spot handling
@@ -1696,6 +1696,7 @@ sub handle_93
                return;
        }
 
+       # remember that we are converting PC10->PC93
        unless ($self->{do_pc9x}) {
                dbg("PCPROT: PC9x come in from non-PC9x node, ignored") if isdbg('chanerr');
                return;
@@ -1739,13 +1740,15 @@ sub handle_93
                $dxchan = DXChannel::get($main::myalias) if $to eq $main::mycall;
                $dxchan = DXChannel::get($to) unless $dxchan;
                # check it...
-               if (ref $dxchan && $dxchan->isa('DXChannel')) {
-                       if ($dxchan->is_user) {
-                               $dxchan->talk($from, $to, $via, $text, $onode);
-                               return;
+               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)");
                        }
-               } else {
-                       dbg("ERROR: $to -> $dxchan is not a DXChannel! (local talk)");
                }
 
                # convert to PC10 talks where appropriate