fix users delete? messages, local::pcprot()
[spider.git] / perl / DXProt.pm
index 95940e58690084d097dfcf9ed4006c38921faab0..67dc56632d80b4d2e06abcb509daa2d239c7c71e 100644 (file)
@@ -33,6 +33,7 @@ use Route;
 use Route::Node;
 use Script;
 use DXProtHandle;
+use DXCIDR;
 
 use Time::HiRes qw(gettimeofday tv_interval);
 use DXSubprocess;
@@ -82,7 +83,7 @@ $pc92_extnode_update_period = 1*60*60; # the update period for external nodes
 $pc92_keepalive_period = 1*60*60;      # frequency of PC92 K (keepalive) records
 %pc92_find = ();                               # outstanding pc92 find operations
 $pc92_find_timeout = 30;               # maximum time to wait for a reply
-$senderverify = 1;                             # 1 = check spotter is on node it says it is and check ip address if available
+$senderverify = 0;                             # 1 = check spotter is on node it says it is and check ip address if available
                                 # 2 = do 1 and dump if check 
 
 
@@ -297,9 +298,9 @@ sub start
        # log it
        my $host = $self->{conn}->peerhost;
        $host ||= "AGW Port #$self->{conn}->{agwport}" if exists $self->{conn}->{agwport};
+       $host ||= $host if is_ipaddr($host);
        $host ||= "unknown";
        $self->{hostname} = $host if is_ipaddr($host);
-
        Log('DXProt', "$call connected from $host");
 
        # remember type of connection
@@ -428,14 +429,15 @@ sub normal
                }
        }
 
+       my $origin = $self->{call};
+
        if (defined &Local::pcprot) {
                my $r;
-               eval { $r = Local::pcprot($self, $pcno, $line, @field); };
+               eval { $r = Local::pcprot($self, $pcno, $line,  $origin, \@field); };
                return if $r;                   # i.e don't process it
        }
 
        # send it out for processing
-       my $origin = $self->{call};
        no strict 'subs';
        my $sub = "handle_$pcno";
 
@@ -738,6 +740,7 @@ sub send_announce
        }
 
        Log('ann', $target, $from, $text);
+       AnnTalk::add_anncache('ann', $target, $from, $text);
 
        # send it if it isn't the except list and isn't isolated and still has a hop count
        # taking into account filtering and so on
@@ -1777,6 +1780,8 @@ sub import_chat
                                my $via = $target;
                                $via = '*' if $target eq 'ALL' || $target eq 'SYSOP';
                                Log('ann', $target, $main::mycall, $text);
+                               AnnTalk::add_anncache('ann', $target, $main::mycall, $text);
+                               
                                $main::me->normal(DXProt::pc93($target, $main::mycall, $via, $text));
                        } else {
                                DXCommandmode::send_chats($main::me, $target, $text);