2 # set the qra locator field
4 # Copyright (c) 1998 - Dirk Koopman
9 my ($self, $line) = @_;
10 my $call = $self->call;
13 # remove leading and trailing spaces
17 return (1, $self->msg('qrae1')) if !$line;
18 return (1, $self->msg('qrae2', $line)) unless is_qra($line);
20 $user = DXUser->get_current($call);
23 my $oldqra = $user->qra || "";
24 if ($oldqra ne $qra) {
26 my $s = DXProt::pc41($call, 5, $qra);
28 DXProt::broadcast_all_ak1a($s, $DXProt::me);
30 my ($lat, $long) = DXBearing::qratoll($qra);
31 my $oldlat = $user->lat || 0;
32 my $oldlong = $user->long || 0;
33 if ($oldlat != $lat || $oldlong != $long) {
36 my $l = DXBearing::lltos($lat, $long);
37 my $s = DXProt::pc41($call, 3, $l);
39 DXProt::broadcast_all_ak1a($s, $DXProt::me) ;
43 return (1, $self->msg('qra', $line));
45 return (1, $self->msg('namee2', $call));