- my %n2item = map { ($ids->[$i++], $_) } $mset->items;
- while ($over->expand_thread($ctx)) {
- for my $n (@{$ctx->{xids}}) {
- my $smsg = $over->get_art($n) or next;
- my $mitem = delete $n2item{$smsg->{num}};
- next if $smsg->{bytes} == 0;
- if ($mitem) {
- if ($can_kw) {
+ if ($threads) {
+ # copy $ids if $lss since over->expand_thread
+ # shifts @{$ctx->{ids}}
+ $first_ids = [ @$ids ] if $lss;
+ my $ctx = { ids => $ids };
+ my %n2item = map { ($ids->[$i++], $_) } $mset->items;
+ while ($over->expand_thread($ctx)) {
+ for my $n (@{$ctx->{xids}}) {
+ my $smsg = $over->get_art($n) or next;
+ my $mitem = delete $n2item{$n};
+ next if $smsg->{bytes} == 0;
+ if ($mitem && $can_kw) {