clean up various things and add the DXXml.pm module
[spider.git] / perl / DXProt.pm
index 7f30ae62acd446da059cc45283cfe8e6af00bdfe..39b023c482705163e1be93f84e256766cbffcfa9 100644 (file)
@@ -50,7 +50,8 @@ use vars qw($pc11_max_age $pc23_max_age $last_pc50 $eph_restime $eph_info_restim
                        $pingint $obscount %pc19list $chatdupeage $chatimportfn
                        $investigation_int $pc19_version $myprot_version
                        %nodehops $baddx $badspotter $badnode $censorpc $rspfcheck
-                       $allowzero $decode_dk0wcy $send_opernam @checklist);
+                       $allowzero $decode_dk0wcy $send_opernam @checklist
+                       $handle_xml);
 
 $pc11_max_age = 1*3600;                        # the maximum age for an incoming 'real-time' pc11
 $pc23_max_age = 1*3600;                        # the maximum age for an incoming 'real-time' pc23
@@ -78,6 +79,7 @@ $chatdupeage = 20 * 60 * 60;
 $chatimportfn = "$main::root/chat_import";
 $investigation_int = 12*60*60; # time between checks to see if we can see this node
 $pc19_version = 5466;                  # the visible version no for outgoing PC19s generated from pc59
+$handle_xml = 0;                               # handle XML sentences
 
 @checklist = 
 (
@@ -326,21 +328,6 @@ sub sendinit
        $self->send(pc18());
 }
 
-sub removepc90
-{
-       $_[0] =~ s/^PC90\^[-A-Z0-9]+\^\d+\^//;
-       $_[0] =~ s/^PC91\^[-A-Z0-9]+\^\d+\^[-A-Z0-9]+\^//;
-}
-
-#sub send
-#{
-#      my $self = shift;
-#      while (@_) {
-#              my $line = shift;
-#              $self->SUPER::send($line);
-#      }
-#}
-
 #
 # This is the normal pcxx despatcher
 #
@@ -348,9 +335,6 @@ sub normal
 {
        my ($self, $line) = @_;
 
-       # remove any incoming PC90 frames
-       removepc90($line);
-
        my @field = split /\^/, $line;
        return unless @field;
        
@@ -946,6 +930,7 @@ sub handle_18
                        $self->user->put;
                        $self->sort('S');
                }
+               $self->handle_xml++ if $_[1] =~ /\bxml\b/;
        } else {
                $self->version(50.0);
                $self->version($_[2] / 100) if $_[2] && $_[2] =~ /^\d+$/;