detail changes
[spider.git] / perl / DXCommandmode.pm
index aa6f743d39d3657546cee962364193c26b4ac044..8e5d789bdd5e36ae7e43a62dd52daa452db1c94a 100644 (file)
@@ -64,11 +64,13 @@ sub new
        # routing, this must go out here to prevent race condx
        my $pkg = shift;
        my $call = shift;
-       my @rout = $main::routeroot->add_user($call, Route::here(1));
+       my $uref = Route::User::get($call) || Route::User->new($call);
+       $uref->here(1);
+       $uref->conf(0);
+       $main::routeroot->add_user($uref);
 
        # ALWAYS output the user
-       my $ref = Route::User::get($call);
-       $main::me->route_pc16($main::mycall, undef, $main::routeroot, $ref) if $ref;
+       $main::me->route_pc16($main::mycall, undef, $main::routeroot, $uref);
 
        return $self;
 }
@@ -346,7 +348,7 @@ sub send_talks
        $to = $ent unless $to;
        my $call = $via ? $via : $to;
        my $clref = Route::get($call);
-       my $dxchan = $clref->dxchan if $clref;
+       my $dxchan = $clref->bestdxchan if $clref;
        if ($dxchan) {
                $dxchan->talk($self->{call}, $to, $via, $line);
        } else {
@@ -763,7 +765,7 @@ sub talk
                my $key = "$to$from";
                unless (exists $nothereslug{$key}) {
                        my ($ref, $dxchan);
-                       if (($ref = Route::get($from)) && ($dxchan = $ref->dxchan)) {
+                       if (($ref = Route::get($from)) && ($dxchan = $ref->bestdxchan)) {
                                my $name = $self->user->name || $to;
                                my $s = $self->user->nothere || $dxchan->msg('nothere', $name);
                                $nothereslug{$key} = $main::systime;