-sub msg_html_more {
- my ($ctx, $more, $nr) = @_;
- my $str = eval {
- my ($id, $prev, $smsg) = @$more;
- my $mid = $ctx->{mid};
- my $ibx = $ctx->{-inbox};
- $smsg = $ibx->smsg_mime($smsg);
- my $next = $ibx->over->next_by_mid($mid, \$id, \$prev);
- @$more = $next ? ($id, $prev, $next) : ();
- if ($smsg) {
- my $mime = $smsg->{mime};
- my $upfx = '../' . mid_escape($smsg->mid) . '/';
- _msg_html_prepare($mime->header_obj, $ctx, $more, $nr) .
- multipart_text_as_html($mime, $upfx, $ctx) .
- '</pre><hr>'
- } else {
- '';
- }
- };
- if ($@) {
- warn "Error lookup up additional messages: $@\n";
- $str = '<pre>Error looking up additional messages</pre>';
- }
- $str;
+sub msg_page_more { # cold
+ my ($ctx, $nr, $id, $prev, $smsg) = @_;
+ my $ibx = $ctx->{-inbox};
+ my $next = $ibx->over->next_by_mid($ctx->{mid}, \$id, \$prev);
+ $ctx->{more} = [ $id, $prev, $next ] if $next;
+ $smsg = $ibx->smsg_mime($smsg) or return '';
+ $ctx->{mhref} = '../' . mid_href($smsg->{mid}) . '/';
+ my $mime = delete $smsg->{mime};
+ $ctx->{obuf} = _msg_page_prepare_obuf($mime->header_obj, $ctx, $nr);
+ multipart_text_as_html($mime, $ctx);
+ ${delete $ctx->{obuf}} .= '</pre><hr>';