Change DXUser->get* to DXUser::get*
[spider.git] / cmd / set / qth.pl
1 #
2 # set the name of the user
3 #
4 # Copyright (c) 1998 - Dirk Koopman
5 #
6 #
7 #
8
9 my ($self, $line) = @_;
10 my $call = $self->call;
11 my $user;
12
13 # remove leading and trailing spaces
14 $line =~ s/^\s+//;
15 $line =~ s/\s+$//;
16 $line =~ s/[{}]//g;   # no braces allowed
17
18 return (1, $self->msg('qthe1')) if !$line;
19
20 $user = DXUser::get_current($call);
21 if ($user) {
22         $user->qth($line);
23         $user->put();
24         my $s = DXProt::pc41($call, 2, $line);
25         DXProt::eph_dup($s);
26         DXChannel::broadcast_all_nodes($s, $main::me) ;
27         return (1, $self->msg('qth', $line));
28 } else {
29         return (1, $self->msg('namee2', $call));
30 }
31