fix chat problem introdcued last update
[spider.git] / perl / DXProtHandle.pm
index 90e7f47196d21f6aa06a22e7dc13be05a87ef777..213e9b4008053d0d7eeb2efdfb1838f2f3c7730e 100644 (file)
@@ -171,13 +171,13 @@ sub handle_11
        # convert the date to a unix date
        my $d = cltounix($_[3], $_[4]);
        # bang out (and don't pass on) if date is invalid or the spot is too old (or too young)
-       if (!$d || ($pcno == 11 && ($d < $main::systime - $pc11_max_age || $d > $main::systime + 900))) {
+       if (!$d || (($pcno == 11 || $pcno == 61) && ($d < $main::systime - $pc11_max_age || $d > $main::systime + 900))) {
                dbg("PCPROT: Spot ignored, invalid date or out of range ($_[3] $_[4])\n") if isdbg('chanerr');
                return;
        }
 
        # is it 'baddx'
-       if ($baddx->in($_[2]) || BadWords::check($_[2]) || $_[2] =~ /COCK/) {
+       if ($baddx->in($_[2]) || BadWords::check($_[2])) {
                dbg("PCPROT: Bad DX spot, ignored") if isdbg('chanerr');
                return;
        }
@@ -197,7 +197,7 @@ sub handle_11
                }
        }
 
-       my @spot = Spot::prepare($_[1], $_[2], $d, $_[5], $nossid, $_[7]);
+       my @spot = Spot::prepare($_[1], $_[2], $d, $_[5], $nossid, $_[7], $_[8]);
        # global spot filtering on INPUT
        if ($self->{inspotsfilter}) {
                my ($filter, $hops) = $self->{inspotsfilter}->it(@spot);
@@ -321,6 +321,12 @@ sub handle_12
                return;
        }
 
+       # ignore PC12s from origins that use PCxx protocol
+       my $oref = Route::get($origin);
+       if ($oref->do_pc9x) {
+               dbg("PCPROT: PC12 rxed from PC9x node, ignored") if isdbg('chanerr');
+               return;
+       }
 
        my $dxchan;
 
@@ -1404,15 +1410,25 @@ sub _add_thingy
        my @rout;
 
        if ($call) {
+               my $ncall = $parent->call;
                if ($is_node) {
-                       dbg("ROUTE: added node $call to " . $parent->call) if isdbg('routelow');
+                       dbg("ROUTE: added node $call to $ncall") if isdbg('routelow');
                        @rout = $parent->add($call, $version, Route::here($here), $ip);
                        my $r = Route::Node::get($call);
                        $r->PC92C_dxchan($dxchan->call, $hops) if $r;
+                       if ($ip) {
+                               $r->ip($ip);
+                               Log('DXProt', "PC92A $call -> $ip on $ncall");
+                       }
                } else {
-                       dbg("ROUTE: added user $call to " . $parent->call) if isdbg('routelow');
+                       dbg("ROUTE: added user $call to $ncall") if isdbg('routelow');
                        @rout = $parent->add_user($call, Route::here($here), $ip);
-                       $dxchan->tell_buddies('loginb', $call, $parent->call) if $dxchan;
+                       $dxchan->tell_buddies('loginb', $call, $ncall) if $dxchan;
+                       my $r = Route::User::get($call);
+                       if ($ip) {
+                               $r->ip($ip);
+                               Log('DXProt', "PC92A $call -> $ip on $ncall");
+                       }
                }
                if ($pc92_slug_changes && $parent == $main::routeroot) {
                        $things_add{$call} = Route::get($call);