check for qra locator and offer alternative
[spider.git] / cmd / set / location.pl
index 64f6eb890a5d91ecf4b2976fe8d4767a3a370788..8d1f135073264b5e44290eb7ce2e7696192a0247 100644 (file)
@@ -15,6 +15,7 @@ $line =~ s/^\s+//;
 $line =~ s/\s+$//;
 
 return (1, $self->msg('loce1')) if !$line;
+return (1, $self->msg('loce3', uc $line)) if DXBearing::is_qra($line);
 return (1, $self->msg('loce2', $line)) unless $line =~ /\d+ \d+ [NnSs] \d+ \d+ [EeWw]/o;
 
 $user = DXUser->get_current($call);
@@ -23,9 +24,9 @@ if ($user) {
        my ($lat, $long) = DXBearing::stoll($line);
        $user->lat($lat);
        $user->long($long);
-       DXProt::broadcast_ak1a(DXProt::pc41($call, 3, $line), $DXProt::me);
-       if (!$user->qra) {
-               my $qra = DXBearing::lltos($lat, $long);
+       DXProt::broadcast_all_ak1a(DXProt::pc41($call, 3, $line), $DXProt::me);
+       unless ($user->qra && DXBearing::is_qra($user->qra) ) {
+               my $qra = DXBearing::lltoqra($lat, $long);
                $user->qra($qra);
        }