]> dxcluster.net Git - spider.git/blob - cmd/set/usstate.pl
back port registration from mojo
[spider.git] / cmd / set / usstate.pl
1 #
2 # set the usstate flag
3 #
4 # Copyright (c) 2000 - Dirk Koopman
5 #
6 #
7 #
8
9 my ($self, $line) = @_;
10 my @args = split /\s+/, $line;
11 my $call;
12 my @out;
13
14 return (1, $self->msg('db3', 'FCC USDB')) unless $USDB::present;
15
16 @args = $self->call if (!@args || $self->priv < 9);
17
18 foreach $call (@args) {
19         $call = uc $call;
20         my $user = DXUser::get_current($call);
21         if ($user) {
22                 $user->wantusstate(1);
23                 if ($user->wantdxitu) {
24                         push @out, $self->msg('dxituu', $call);
25                         $user->wantdxitu(0);
26                 }
27                 if ($user->wantdxcq) {
28                         push @out, $self->msg('dxcqu', $call);
29                         $user->wantdxcq(0);
30                 }
31                 $user->put;
32                 push @out, $self->msg('usstates', $call);
33         } else {
34                 push @out, $self->msg('e3', "Set US State", $call);
35         }
36 }
37 return (1, @out);