2 # kill or delete a message
4 # Copyright (c) Dirk Koopman G1TLH
11 my ($self, $line) = @_;
12 my @f = split /\s+/, $line;
18 my $call = $self->call;
26 return (1, $self->msg('e5')) if $self->priv < 5;
28 } elsif ($f =~ /^\d+$/o) {
29 $ref = DXMsg::get($f);
31 push @out, "Msg $f not found";
34 if ($self->priv < 5 && $ref->to ne $call && $ref->from ne $call) {
35 push @out, "Msg $f not available";
39 } elsif ($f =~ /(\d+)-(\d+)/) {
42 @refs = grep { !($self->priv < 5 && $_->to ne $call && $_->from ne $call) } DXMsg::get_all() unless @refs;
43 @refs = grep { $_->msgno >= $from && $_->msgno <= $to } @refs;
44 } elsif ($f =~ /^fr/io) {
48 @refs = grep { !($self->priv < 5 && $_->to ne $call && $_->from ne $call) } DXMsg::get_all() unless @refs;
49 @refs = grep { $_->from =~ m{$f}i } @refs;
51 } elsif ($f =~ /^to/io) {
55 @refs = grep { !($self->priv < 5 && $_->to ne $call && $_->from ne $call) } DXMsg::get_all() unless @refs;
56 @refs = grep { $_->to =~ m{$f}i } @refs;
59 push @out, "invalid argument '$f'";
64 foreach $ref ( @refs) {
65 Log('msg', "Message $ref->{msgno} from $ref->{from} to $ref->{to} deleted by $call");
67 DXProt::broadcast_ak1a(DXProt::pc49($ref->{from}, $ref->{subject}), $DXProt::me);
70 push @out, $self->msg('m12', $ref->msgno);