2 # set the latitude and longtitude 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('loce1')) if !$line;
18 return (1, $self->msg('loce3', uc $line)) if is_qra($line);
19 return (1, $self->msg('loce2', $line)) unless is_latlong($line);
21 $user = DXUser::get_current($call);
24 my ($lat, $long) = DXBearing::stoll($line);
25 my $oldlat = $user->lat || 0;
26 my $oldlong = $user->long || 0;
27 if ($oldlat != $lat || $oldlong != $long) {
30 my $l = DXBearing::lltos($lat, $long);
31 my $s = DXProt::pc41($call, 3, $l);
33 DXChannel::broadcast_all_nodes($s, $main::me) ;
35 my $qra = DXBearing::lltoqra($lat, $long);
36 my $oldqra = $user->qra || "";
37 if ($oldqra ne $qra) {
39 my $s = DXProt::pc41($call, 5, $qra);
41 DXChannel::broadcast_all_nodes($s, $main::me);
45 return (1, $self->msg('loc', $line));
47 return (1, $self->msg('namee2', $call));