This makes life easier for the threading algorithm, as we can
use the implied ordering of timestamps to avoid temporary ghosts
and resulting container vivication.
This would've also allowed us to hide the bug (in most cases)
fixed by the patch titled "thread: last Reference always wins",
in case that needs to be reverted due to infinite looping.
cb => $cb,
ctx => $ctx,
msgs => [],
cb => $cb,
ctx => $ctx,
msgs => [],
- opts => { asc => 1, offset => 0 },
+ opts => { offset => 0 },
}
$opts ||= {};
$opts->{limit} ||= 1000;
}
$opts ||= {};
$opts->{limit} ||= 1000;
+
+ # always sort threads by timestamp, this makes life easier
+ # for the threading algorithm (in SearchThread.pm)
+ $opts->{asc} = 1;
+
_do_enquire($self, $qtid, $opts);
}
_do_enquire($self, $qtid, $opts);
}
sub thread_html {
my ($ctx) = @_;
my $mid = $ctx->{mid};
sub thread_html {
my ($ctx) = @_;
my $mid = $ctx->{mid};
- my $sres = $ctx->{srch}->get_thread($mid, { asc => 1 });
+ my $sres = $ctx->{srch}->get_thread($mid);
my $msgs = load_results($sres);
my $nr = $sres->{total};
return missing_thread($ctx) if $nr == 0;
my $msgs = load_results($sres);
my $nr = $sres->{total};
return missing_thread($ctx) if $nr == 0;