X-Git-Url: http://dxcluster.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=cmd%2Fcatchup.pl;h=20020067b8d90a87e4750c24cc0c0ae7e70d4231;hb=refs%2Fheads%2Flegacy-1.53;hp=4cda1203fe85d8dc93ae41b0438897a0cb724c3b;hpb=f0ac8322367c66080b6dbb74da4de72dae126dc3;p=spider.git diff --git a/cmd/catchup.pl b/cmd/catchup.pl index 4cda1203..20020067 100644 --- a/cmd/catchup.pl +++ b/cmd/catchup.pl @@ -10,9 +10,46 @@ # my ($self, $line) = @_; +return (1, $self->msg('e5')) if $self->priv < 5; + my @f = split /\s+/, $line; +return (1, "usage: catchup all|[= 2; + my $call = uc shift @f; +my $user = DXUser->get_current($call); +return (1, "$call not a node") unless $user && $user->sort ne 'U'; + my @out; +my $ref; +my @ref; + +# get a more or less valid set of messages +foreach my $msgno (@f) { + if ($msgno =~ /^al/i) { + @ref = DXMsg::get_all(); + last; + } elsif (my ($f, $t) = $msgno =~ /(\d+)-(\d+)/) { + while ($f <= $t) { + $ref = DXMsg::get($f++); + push @ref, $ref if $ref; + } + } else { + $ref = DXMsg::get($msgno); + unless ($ref) { + push @out, $self->msg('m13', $msgno); + next; + } + push @ref, $ref; + } +} +foreach $ref (@ref) { + next if $ref->{private}; + unless (grep {$_ eq $call} @{$ref->{gotit}}) { + push @{$ref->{gotit}}, $call; # mark this up as being received + $ref->store( [ $ref->read_msg_body() ] ); # re- store the file + push @out, $self->msg('m14', $ref->{msgno}, $call); + } +} return (1, @out);