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();
31 } elsif (my ($f, $t) = $msgno =~ /(\d+)-(\d+)/) {
33 $ref = DXMsg::get($f++);
34 push @ref, $ref if $ref;
37 $ref = DXMsg::get($msgno);
39 push @out, $self->msg('m13', $msgno);
47 next if $ref->{private};
48 if (grep {$_ eq $call} @{$ref->{gotit}}) {
49 $ref->{gotit} = [ grep {$_ ne $call} @{$ref->{gotit}} ]; # mark this up as NOT being received
50 $ref->store( [ $ref->read_msg_body() ] ); # re- store the file
51 push @out, $self->msg('m15', $ref->{msgno}, $call);