add more fixes for peerhosts
[spider.git] / perl / DXCommandmode.pm
index 6fde1742b6067b8b3b1d717bfdbe073b51c5c29f..798351773c998c62f603facd84c093c782873d34 100644 (file)
@@ -65,7 +65,7 @@ sub new
        my $pkg = shift;
        my $call = shift;
 #      my @rout = $main::routeroot->add_user($call, Route::here(1));
-       DXProt::_add_thingy($main::routeroot, [$call, 0, 0, 1]);
+       DXProt::_add_thingy($main::routeroot, [$call, 0, 0, 1, undef, undef, $self->{conn}->peerhost], );
 
        # ALWAYS output the user
        my $ref = Route::User::get($call);
@@ -89,7 +89,7 @@ sub start
        my $name = $user->{name};
        
        # log it
-       my $host = $self->{conn}->{peerhost};
+       my $host = $self->{conn}->peerhost;
        $host ||= "AGW Port #$self->{conn}->{agwport}" if exists $self->{conn}->{agwport};
        $host ||= "unknown";
        LogDbg('DXCommand', "$call connected from $host");
@@ -1224,7 +1224,7 @@ sub send_motd
        }
        $motd = "${main::motd}_$self->{lang}" unless $motd && -e $motd;
        $motd = $main::motd unless $motd && -e $motd;
-       if ($self->conn->{csort} eq 'ax25') {
+       if ($self->conn->ax25) {
                if ($motd) {
                        $motd = "${motd}_ax25" if -e "${motd}_ax25";
                } else {