pass the correct line to PCProt
[spider.git] / perl / QXProt.pm
index 38d878ed3b73be1ffcac23e0807a319219af0952..41b34d6f2eacc03ca4a5d5b9f85c980b7bc62c64 100644 (file)
@@ -152,7 +152,7 @@ sub frame
 sub send_frame
 {
        my $self = shift;
-       my $origin = shift;
+       my $origin = shift || $main::me;
        for (@_) {
                $self->send(frame('X', undef, $origin == $main::me || $origin->is_user ? '' : $origin->call, $_));
        }
@@ -163,7 +163,7 @@ sub handleI
        my $self = shift;
        
        my @f = split /\^/, $_[3];
-       if ($self->passphrase && $f[7] && $f[8]) {
+       if ($self->user->passphrase && $f[7] && $f[8]) {
                my $inv = Verify->new($f[7]);
                unless ($inv->verify($f[8], $main::me->user->passphrase, $main::mycall, $self->call)) {
                        $self->sendnow('D','Sorry...');
@@ -220,12 +220,12 @@ sub genP
 sub handleX
 {
        my $self = shift;
-       my ($tonode, $fromnode, $msgid, $line) = @_[0..3];
-       my ($origin, $l) = split /\^/, $line, 2;
+       my ($sort, $to, $from, $msgid, $origin, $line) = split /\^/, $_[3], 6;
 
-       my ($pcno) = $l =~ /^PC(\d\d)/;
+       my ($pcno) = $line =~ /^PC(\d\d)/;
        if ($pcno) {
-               DXProt::normal($self, $l);
+               $line =~ s/^[\x\x]$//;
+               DXProt::normal($self, $line);
        }
 }