]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/ExtMsg.pm
config: flatten each_inbox and iterate_start args
[public-inbox.git] / lib / PublicInbox / ExtMsg.pm
index 65892161dec73e3c50126ba14bc88cc1d52408d3..929737f1b9d1961f4c63f556c313494df0db90fb 100644 (file)
@@ -65,17 +65,16 @@ sub search_partial ($$) {
                # has too many results.  $@ can be
                # Search::Xapian::QueryParserError or even:
                # "something terrible happened at ../Search/Xapian/Enquire.pm"
-               my $mset = eval { $srch->query($m, $opt) } or next;
+               my $mset = eval { $srch->mset($m, $opt) } or next;
                my @mids = map {
                        $_->{mid}
-               } @{$ibx->over->get_all(@{$srch->mset_to_artnums($mset)})};
+               } @{$srch->mset_to_smsg($ibx, $mset)};
                return \@mids if scalar(@mids);
        }
 }
 
 sub ext_msg_i {
-       my ($other, $arg) = @_;
-       my ($cur, $mid, $ibxs, $found) = @$arg;
+       my ($other, $cur, $mid, $ibxs, $found) = @_;
 
        return if $other->{name} eq $cur->{name} || !$other->base_url;
 
@@ -101,9 +100,9 @@ sub ext_msg {
        eval { require PublicInbox::Msgmap };
        my $ibxs = [];
        my $found = [];
-       my $arg = [ $cur, $mid, $ibxs, $found ];
 
-       $ctx->{www}->{pi_config}->each_inbox(\&ext_msg_i, $arg);
+       $ctx->{www}->{pi_config}->each_inbox(\&ext_msg_i,
+                                               $cur, $mid, $ibxs, $found);
 
        return exact($ctx, $found, $mid) if @$found;