- my $mime;
- sub {
- return unless $msgs;
- while ($mime = pop @$msgs) {
- $mime = $inbox->msg_by_smsg($mime) and last;
- }
- if ($mime) {
- $mime = PublicInbox::MIME->new($mime);
- return PublicInbox::View::index_entry($mime, $ctx,
- scalar @$msgs);
- }
- $msgs = undef;
- $skel .= "\n</pre>";
- };
+ $ctx->{msgs} = $msgs;
+ PublicInbox::WwwStream::response($ctx, 200, \&mset_thread_i);
+}
+
+# callback for PublicInbox::WwwStream::getline
+sub mset_thread_i {
+ my ($ctx) = @_;
+ return $ctx->html_top if exists $ctx->{-html_tip};
+ my $msgs = $ctx->{msgs} or return;
+ while (my $smsg = pop @$msgs) {
+ my $eml = $ctx->{-inbox}->smsg_eml($smsg) or next;
+ return PublicInbox::View::eml_entry($ctx, $smsg, $eml,
+ scalar @$msgs);
+ }
+ my ($skel) = delete @$ctx{qw(skel msgs)};
+ $$skel .= "\n</pre>";