-sub each_smsg_by_mid {
- my ($self, $mid, $cb) = @_;
- # XXX retry_reopen isn't necessary for V2Writable, but the PSGI
- # interface will need it...
- my $db = $self->{xdb};
- my $term = 'Q' . $mid;
- my $head = $db->postlist_begin($term);
- my $tail = $db->postlist_end($term);
- if ($head == $tail) {
- $db->reopen;
- $head = $db->postlist_begin($term);
- $tail = $db->postlist_end($term);
- }
- return ($head, $tail, $db) if wantarray;
- for (; $head->nequal($tail); $head->inc) {
- my $doc_id = $head->get_docid;
- my $doc = $db->get_document($doc_id);
- my $smsg = PublicInbox::SearchMsg->wrap($doc, $mid);
- $smsg->{doc_id} = $doc_id;
- $cb->($smsg) or return;
- }
+sub next_by_mid {
+ my ($self, $mid, $id, $prev) = @_;
+ $self->{over_ro}->next_by_mid($mid, $id, $prev);