*smsg_by_mid = \&PublicInbox::Inbox::smsg_by_mid;
*msg_by_mid = \&PublicInbox::Inbox::msg_by_mid;
*modified = \&PublicInbox::Inbox::modified;
-*recent = \&PublicInbox::Inbox::recent;
*max_git_epoch = *nntp_usable = *msg_by_path = \&mm; # undef
*isrch = \&search;
$smsg ? msg_by_smsg($self, $smsg) : msg_by_path($self, mid2path($mid));
}
-sub recent {
- my ($self, $opts, $after, $before) = @_;
- $self->over->recent($opts, $after, $before);
-}
-
sub modified {
my ($self) = @_;
if (my $over = $self->over) {
*smsg_by_mid = \&PublicInbox::Inbox::smsg_by_mid;
*msg_by_mid = \&PublicInbox::Inbox::msg_by_mid;
*modified = \&PublicInbox::Inbox::modified;
-*recent = \&PublicInbox::Inbox::recent;
*max_git_epoch = *nntp_usable = *msg_by_path = \&mm; # undef
*isrch = *search = \&mm; # TODO
*DESTROY = \&pause_dedupe;
$smsg;
}
-sub recent {
- my ($self, $qstr, $opt) = @_;
- $opt //= {};
- $opt->{relevance} //= -2;
- $self->mset($qstr //= 'z:1..', $opt);
-}
-
sub over {}
sub _check_mset_limit ($$$) {
$t =~ s/\A([0-9]{8,14})-// and $after = str2ts($1);
$t =~ /\A([0-9]{8,14})\z/ and $before = str2ts($1);
- my $ibx = $ctx->{ibx};
- my $msgs = $ibx->recent($opts, $after, $before);
+ my $msgs = $ctx->{ibx}->over->recent($opts, $after, $before);
my $nr = scalar @$msgs;
if ($nr < $lim && defined($after)) {
$after = $before = undef;
- $msgs = $ibx->recent($opts);
+ $msgs = $ctx->{ibx}->over->recent($opts);
$nr = scalar @$msgs;
}
my $more = $nr == $lim;
is($st[2] & 07777, -f _ ? 0444 : 0755,
'sharedRepository respected after v2 compact');
}
-my $msgs = $ibx->recent({limit => 1000});
+my $msgs = $ibx->over->recent({limit => 1000});
is($msgs->[0]->{mid}, 'a-mid@b', 'message exists in history');
is(scalar @$msgs, 1, 'only one message in history');
inboxdir => $ibx->{inboxdir},
indexlevel => $level
});
- my $msgs = $ro_master->recent;
+ my $msgs = $ro_master->over->recent;
is(scalar(@$msgs), 1, 'only one message in master, so far');
is($msgs->[0]->{mid}, 'm@1', 'first message in master indexed');
inboxdir => $mirror,
indexlevel => $level,
});
- $msgs = $ro_mirror->recent;
+ $msgs = $ro_mirror->over->recent;
is(scalar(@$msgs), 1, 'only one message, so far');
is($msgs->[0]->{mid}, 'm@1', 'read first message');
# mirror updates
is(xsys('git', "--git-dir=$fetch_dir", qw(fetch -q)), 0, 'fetch OK');
ok(run_script([qw(-index -j0), $mirror]), "v$v index mirror again OK");
- $msgs = $ro_mirror->recent;
+ $msgs = $ro_mirror->over->recent;
is(scalar(@$msgs), 2, '2nd message seen in mirror');
is_deeply([sort { $a cmp $b } map { $_->{mid} } @$msgs],
['m@1','m@2'], 'got both messages in mirror');
# incremental index master (required for v1)
ok(run_script([qw(-index -j0), $ibx->{inboxdir}, "-L$level"]),
'index master OK');
- $msgs = $ro_master->recent;
+ $msgs = $ro_master->over->recent;
is(scalar(@$msgs), 2, '2nd message seen in master');
is_deeply([sort { $a cmp $b } map { $_->{mid} } @$msgs],
['m@1','m@2'], 'got both messages in master');
# sync the mirror
is(xsys('git', "--git-dir=$fetch_dir", qw(fetch -q)), 0, 'fetch OK');
ok(run_script([qw(-index -j0), $mirror]), "v$v index mirror again OK");
- $msgs = $ro_mirror->recent;
+ $msgs = $ro_mirror->over->recent;
is(scalar(@$msgs), 1, '2nd message gone from mirror');
is_deeply([map { $_->{mid} } @$msgs], ['m@1'],
'message unavailable in mirror');
}
is(scalar(@msgs), $nr, 'smsgs retrieved for all');
-$mset = $lxs->recent(undef, { limit => 1 });
+$mset = $lxs->mset('z:1..', { relevance => -2, limit => 1 });
is($mset->size, 1, 'one result');
my @ibxish = $lxs->locals;
$im->done;
my $thread_a = $ibx->over->get_thread('replace@example.com');
- my %before = map {; delete($_->{blob}) => $_ } @{$ibx->recent};
+ my %before = map {; delete($_->{blob}) => $_ } @{$ibx->over->recent};
my $reject = PublicInbox::Eml->new($orig->as_string);
foreach my $mid (['<replace@example.com>', '<extra@example.com>'],
[], ['<replaced@example.com>']) {
}
# check overview matches:
- my %after = map {; delete($_->{blob}) => $_ } @{$ibx->recent};
+ my %after = map {; delete($_->{blob}) => $_ } @{$ibx->over->recent};
my @before_blobs = keys %before;
foreach my $blob (@before_blobs) {
delete $before{$blob} if delete $after{$blob};
$im->done;
my $rw = PublicInbox::SearchIdx->new($ibx, 1);
$rw->index_sync;
-my $msgs = $ibx->recent({limit => 10});
+my $msgs = $ibx->over->recent({limit => 10});
is($msgs->[0]->{mid}, 'a-mid@b', 'message exists in history');
is(scalar @$msgs, 1, 'only one message in history');
is($ibx->mm->num_for('a-mid@b'), 2, 'exists with second article number');
ok($im->remove($mime), 'message removed');
ok($im->add($mime), 'message added again');
$im->done;
-my $msgs = $ibx->recent({limit => 1000});
+my $msgs = $ibx->over->recent({limit => 1000});
is($msgs->[0]->{mid}, 'a-mid@b', 'message exists in history');
is(scalar @$msgs, 1, 'only one message in history');