X-Git-Url: http://gb7djk.dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;f=cmd%2Fforward%2Fopername.pl;h=314a9e37b0b5d54e24fa3f334ba94d98736a3dcb;hb=e7e2be52df572de51831fa1b4cde4018aef791a9;hp=2da3d95b5f26f8b2d33c82ba8264db18ddce78b1;hpb=a566ac4046989131d71d2911611b2cd728a1384e;p=spider.git diff --git a/cmd/forward/opername.pl b/cmd/forward/opername.pl index 2da3d95b..314a9e37 100644 --- a/cmd/forward/opername.pl +++ b/cmd/forward/opername.pl @@ -9,25 +9,32 @@ my ($self, $line) = @_; my @f = split /\s+/, uc $line; my @out; -my $call; -if (@f == 0) { - return (1, $self->('e6')) if ($self->priv < 1); -} else { - foreach $call (@f) { - my $ref = DXUser->get_current($call); - if ($ref) { - my $name = $ref->name; - my $qth = $ref->qth; - my $lat = $ref->lat; - my $long = $ref->long; - my $node = $ref->homenode; - my $latlong = DXBearing::lltos($lat, $long) if $lat && $long; - DXProt::broadcast_all_ak1a(DXProt::pc41($call, 1, $name), $DXProt::me) if $name; - DXProt::broadcast_all_ak1a(DXProt::pc41($call, 2, $qth), $DXProt::me) if $qth; - DXProt::broadcast_all_ak1a(DXProt::pc41($call, 3, $latlong), $DXProt::me) if $latlong; - DXProt::broadcast_all_ak1a(DXProt::pc41($call, 4, $node), $DXProt::me) if $node; - } +if ($self->priv < 1) { + if (@f == 0) { + push @f, $self->call; + } else { + return (1, $self->msg('e5')); + } +} elsif (@f == 0) { + return (1, $self->msg('e6')); +} + +my $call; +foreach $call (@f) { + my $ref = DXUser->get_current($call); + if ($ref) { + my $name = $ref->name; + my $qth = $ref->qth; + my $lat = $ref->lat; + my $long = $ref->long; + my $node = $ref->homenode; + my $latlong = DXBearing::lltos($lat, $long) if $lat && $long; + DXProt::broadcast_all_ak1a(DXProt::pc41($call, 1, $name), $DXProt::me) if $name; + DXProt::broadcast_all_ak1a(DXProt::pc41($call, 2, $qth), $DXProt::me) if $qth; + DXProt::broadcast_all_ak1a(DXProt::pc41($call, 3, $latlong), $DXProt::me) if $latlong; + DXProt::broadcast_all_ak1a(DXProt::pc41($call, 4, $node), $DXProt::me) if $node; } } + return (1, @out);