No point in munging user-supplied $lei->{opt} when %mset_opt
exists. We'll be depending on docid being in descending order
for saved search support.
if ($json) {
$lei->{dedupe} //= PublicInbox::LeiDedupe->new($lei);
} else {
if ($json) {
$lei->{dedupe} //= PublicInbox::LeiDedupe->new($lei);
} else {
- # default to the cheapest sort since MUA usually resorts
- $opt->{'sort'} //= 'docid' if $devfd < 0;
$lei->{l2m} = eval { PublicInbox::LeiToMail->new($lei) };
return $lei->fail($@) if $@;
if ($opt->{mua} && $lei->{l2m}->lock_free) {
$lei->{l2m} = eval { PublicInbox::LeiToMail->new($lei) };
return $lei->fail($@) if $@;
if ($opt->{mua} && $lei->{l2m}->lock_free) {
die "unrecognized --sort=$sort\n";
}
}
die "unrecognized --sort=$sort\n";
}
}
- # descending docid order
- $mset_opt{relevance} //= -2 if $opt->{threads};
+ # descending docid order is cheapest, MUA controls sorting order
+ $mset_opt{relevance} //= -2 if $self->{l2m} || $opt->{threads};
$self->{mset_opt} = \%mset_opt;
if ($opt->{stdin}) {
$self->{mset_opt} = \%mset_opt;
if ($opt->{stdin}) {