2 # catchup some or all of the non-private messages for a node.
4 # in other words mark all messages as being already received
9 # Copyright (c) 1999 Dirk Koopman G1TLH
12 my ($self, $line) = @_;
13 return (1, $self->msg('e5')) if $self->priv < 5;
15 my @f = split /\s+/, $line;
16 return (1, "usage: catchup <node call> all|[<msgno ...]") unless @f >= 2;
18 my $call = uc shift @f;
19 my $user = DXUser->get_current($call);
20 return (1, "$call not a node") unless $user && $user->sort ne 'U';
26 # get a more or less valid set of messages
27 foreach my $msgno (@f) {
28 if ($msgno =~ /^al/oi) {
29 @ref = DXMsg::get_all();
32 $ref = DXMsg::get($msgno);
34 push @out, $self->msg('m13', $msgno);
41 next if $ref->{private};
42 if (grep {$_ eq $call} @{$ref->{gotit}}) {
43 $ref->{gotit} = [ grep {$_ ne $call} @{$ref->{gotit}} ]; # mark this up as NOT being received
44 $ref->store( [ $ref->read_msg_body() ] ); # re- store the file
45 push @out, $self->msg('m15', $ref->{msgno}, $call);