spider/cmd/unset/wantpc9x.pl
Dirk Koopman ab811a0c90 Change DXUser->get* to DXUser::get*
and also check the output of thaw more carefully, complain if it
isn't a DXUser.
2008-05-06 15:00:00 +01:00

29 lines
505 B
Perl

#
# unset the wantpc9x flag
#
# Copyright (c) 2007 - Dirk Koopman
#
#
#
my ($self, $line) = @_;
my @args = split /\s+/, uc $line;
my $call;
my @out;
return (1, $self->msg('e5')) if $self->priv < 9;
foreach $call (@args) {
return (1, $self->msg('e12')) unless is_callsign($call);
my $user = DXUser::get_current($call);
if ($user) {
$user->wantpc9x(0);
$user->put;
push @out, $self->msg('wpc9xu', $call);
} else {
push @out, $self->msg('e3', "unset/wantpc9x", $call);
}
}
return (1, @out);