From f1b5592c74a4bf0723b4e1d8854dbacdd5f7f495 Mon Sep 17 00:00:00 2001 From: minima Date: Sun, 23 Feb 2003 19:52:49 +0000 Subject: [PATCH] enforce the mutual exclusivity of dxcq, dxitu and usstate --- cmd/set/dxcq.pl | 8 ++++++++ cmd/set/dxitu.pl | 8 ++++++++ cmd/set/usstate.pl | 8 ++++++++ 3 files changed, 24 insertions(+) diff --git a/cmd/set/dxcq.pl b/cmd/set/dxcq.pl index c70ff168..0b6eeb7a 100644 --- a/cmd/set/dxcq.pl +++ b/cmd/set/dxcq.pl @@ -18,6 +18,14 @@ foreach $call (@args) { my $user = DXUser->get_current($call); if ($user) { $user->wantdxcq(1); + if ($user->wantdxitu) { + push @out, $self->msg('dxituu', $call); + $user->wantdxitu(0); + } + if ($user->wantusstate) { + push @out, $self->msg('usstateu', $call); + $user->wantusstate(0); + } $user->put; push @out, $self->msg('dxcqs', $call); } else { diff --git a/cmd/set/dxitu.pl b/cmd/set/dxitu.pl index 7b68a31a..cb8da9d0 100644 --- a/cmd/set/dxitu.pl +++ b/cmd/set/dxitu.pl @@ -18,6 +18,14 @@ foreach $call (@args) { my $user = DXUser->get_current($call); if ($user) { $user->wantdxitu(1); + if ($user->wantdxcq) { + push @out, $self->msg('dxcqu', $call); + $user->wantdxcq(0); + } + if ($user->wantusstate) { + push @out, $self->msg('usstateu', $call); + $user->wantusstate(0); + } $user->put; push @out, $self->msg('dxitus', $call); } else { diff --git a/cmd/set/usstate.pl b/cmd/set/usstate.pl index dd55cac2..7403843b 100644 --- a/cmd/set/usstate.pl +++ b/cmd/set/usstate.pl @@ -20,6 +20,14 @@ foreach $call (@args) { my $user = DXUser->get_current($call); if ($user) { $user->wantusstate(1); + if ($user->wantdxitu) { + push @out, $self->msg('dxituu', $call); + $user->wantdxitu(0); + } + if ($user->wantdxcq) { + push @out, $self->msg('dxcqu', $call); + $user->wantdxcq(0); + } $user->put; push @out, $self->msg('usstates', $call); } else { -- 2.43.0