restructure all the busy/fwq stuff and hide them all in subroutines
[spider.git] / cmd / kill.pl
index fb58bc247c09655408dbb91193f7fe596c518e75..b98a42f69b2c5d3947e58e5d5e0e6cc0a92d9a0a 100644 (file)
@@ -40,7 +40,7 @@ while (@f) {
                my $from = $1;
                my $to = $2;
                @refs = grep { !($self->priv < 5 && $_->to ne $call && $_->from ne $call) } DXMsg::get_all() unless @refs;
-               @refs = grep { $_->msgno >= $from && $_->msgno < $to } @refs;
+               @refs = grep { $_->msgno >= $from && $_->msgno <= $to } @refs;
        } elsif ($f =~ /^fr/io) {
                $f = shift @f;
                if ($f) {
@@ -64,10 +64,12 @@ while (@f) {
 foreach $ref ( @refs) {
        Log('msg', "Message $ref->{msgno} from $ref->{from} to $ref->{to} deleted by $call");
        if ($full) {
-               DXProt::broadcast_all_ak1a(DXProt::pc49($self->call, $ref->{subject}), $DXProt::me);
+               DXChannel::broadcast_nodes(DXProt::pc49($ref->{from}, $ref->{subject}), $main::me);
        }
-       $ref->del_msg;
-       push @out, "Message $ref->{msgno} deleted";
+       my $tonode = $ref->tonode;
+       $ref->stop_msg($tonode) if $tonode;
+       $ref->del_msg($self);
+       push @out, $self->msg('m12', $ref->msgno);
 }
 
 return (1, @out);