remove traling spaces from non empty lines in command output
[spider.git] / cmd / set / sendpc16.pl
diff --git a/cmd/set/sendpc16.pl b/cmd/set/sendpc16.pl
new file mode 100644 (file)
index 0000000..342e99e
--- /dev/null
@@ -0,0 +1,28 @@
+#
+# set the send PC16 flag
+#
+# Copyright (c) 2002 - Dirk Koopman
+#
+# $Id$
+#
+
+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->wantsendpc16(1);
+               $user->put;
+               push @out, $self->msg('wspc16s', $call);
+       } else {
+               push @out, $self->msg('e3', "set/sendpc16", $call);
+       }
+}
+return (1, @out);