added kill
authordjk <djk>
Thu, 1 Oct 1998 10:49:50 +0000 (10:49 +0000)
committerdjk <djk>
Thu, 1 Oct 1998 10:49:50 +0000 (10:49 +0000)
cmd/kill.pl [new file with mode: 0644]

diff --git a/cmd/kill.pl b/cmd/kill.pl
new file mode 100644 (file)
index 0000000..0d787dd
--- /dev/null
@@ -0,0 +1,30 @@
+#
+# kill or delete a message
+#
+# Copyright (c) Dirk Koopman G1TLH
+#
+# $Id$
+#
+
+my ($self, $line) = @_;
+my @f = split /\s+/, $line;
+my $msgno;
+my @out;
+my @body;
+my $ref;
+
+for $msgno (@f) {
+  $ref = DXMsg::get($msgno);
+  if (!$ref) {
+    push @out, "Msg $msgno not found";
+       next;
+  }
+  if ($ref->private && $self->priv < 9 && $ref->to ne $ref->call) {
+    push @out, "Msg $msgno not available";
+       next;
+  }
+  $ref->del_msg;
+  push @out, "Message $msgno deleted";
+}
+
+return (1, @out);