X-Git-Url: http://gb7djk.dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;f=cmd%2Fshow%2Fusers.pl;h=46d641edf1430f81cd234284425fdf3a584f9f45;hb=668e4252d23e2eda2a6b234f1031e1c1a5f43d15;hp=55a34bec954be8beab2c6c76eaf6920d8b0f961f;hpb=f3688be5d3f50cccf204d3d01dcaca1e9db7d4f7;p=spider.git diff --git a/cmd/show/users.pl b/cmd/show/users.pl index 55a34bec..46d641ed 100644 --- a/cmd/show/users.pl +++ b/cmd/show/users.pl @@ -7,29 +7,33 @@ # my ($self, $line) = @_; -my @list = map { uc } split /\s+/, $line; # list of callsigns of nodes +my @list = map { uc } split /\s+/, $line; # list of callsigns of nodes my @out; -my $node = (DXNode->get($main::mycall)); +my $node = $main::routeroot; push @out, "Callsigns connected to $main::mycall"; my $call; my $i = 0; my @l; -my $nlist = $node->list; -my @val = sort {$a->call cmp $b->call} values %{$nlist}; +my @val = sort $node->users; foreach $call (@val) { - if (@list) { - next if !grep $call->call eq $_, @list; - } - if ($i >= 5) { - push @out, sprintf "%-12s %-12s %-12s %-12s %-12s %-12s", @l; - @l = (); - $i = 0; - } - my $s = $call->{call}; - $s = sprintf "(%s)", $s if $call->{here} == 0; - push @l, $s; - $i++; + if (@list) { + next if !grep $call eq $_, @list; + } + if ($i >= 5) { + push @out, sprintf "%-12s %-12s %-12s %-12s %-12s %-12s", @l; + @l = (); + $i = 0; + } + my $uref = Route::User::get($call); + my $s = $call; + if ($uref) { + $s = sprintf "(%s)", $call unless $uref->here; + } else { + $s = "$call?"; + } + push @l, $s; + $i++; } push @out, sprintf "%-12s %-12s %-12s %-12s %-12s %-12s", @l;