started on the prefix stuff, got most of it done
[spider.git] / cmd / set / address.pl
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..f31a982ea3224bd028acdc56b9c5bfbb9bca6905 100644 (file)
@@ -0,0 +1,28 @@
+#
+# set the address field
+#
+# Copyright (c) 1998 - Dirk Koopman
+#
+# $Id$
+#
+
+my ($self, $line) = @_;
+my $call;
+my @out;
+my $user;
+
+if ($self->priv >= 5) {             # allow a callsign as first arg
+  my @args = split /\s+/, $line;
+  $call = UC $args[0];
+  $user = DXUser->get_current($call);
+  shift @args if $user;
+  $line = join ' ', @args;
+} else {
+  $call = $self->call;
+  $user = $self->user;
+}
+
+$user->addr($line);
+push @out, DXM::msg('addr', $call, $line);
+
+return (1, @out);