here to allow users to specify
+ # their own color for quoted text
+ $$rv .= qq();
+ $$rv .= $l->to_html($cur);
+ $$rv .= '';
} elsif ($diff) {
flush_diff($ctx, \$cur);
} else {
# regular lines, OK
$$rv .= $l->to_html($cur);
- $cur = undef;
}
+ undef $cur; # free memory
}
-
- obfuscate_addrs($ibx, $$rv) if $ibx->{obfuscate};
}
sub _msg_page_prepare_obuf {
@@ -831,7 +823,7 @@ sub indent_for {
sub find_mid_root {
my ($ctx, $level, $node, $idx) = @_;
++$ctx->{root_idx} if $level == 0;
- if ($node->{id} eq $ctx->{mid}) {
+ if ($node->{mid} eq $ctx->{mid}) {
$ctx->{found_mid_at} = $ctx->{root_idx};
return 0;
}
@@ -905,8 +897,8 @@ sub dedupe_subject {
}
sub skel_dump { # walk_thread callback
- my ($ctx, $level, $node) = @_;
- my $smsg = $node->{smsg} or return _skel_ghost($ctx, $level, $node);
+ my ($ctx, $level, $smsg) = @_;
+ $smsg->{blob} or return _skel_ghost($ctx, $level, $smsg);
my $skel = $ctx->{skel};
my $cur = $ctx->{cur};
@@ -989,7 +981,7 @@ sub skel_dump { # walk_thread callback
sub _skel_ghost {
my ($ctx, $level, $node) = @_;
- my $mid = $node->{id};
+ my $mid = $node->{mid};
my $d = ' [not found] ';
$d .= ' ' if exists $ctx->{searchview};
$d .= indent_for($level) . th_pfx($level);
@@ -1012,18 +1004,23 @@ sub _skel_ghost {
sub sort_ds {
[ sort {
- (eval { $a->topmost->{smsg}->{ds} } || 0) <=>
- (eval { $b->topmost->{smsg}->{ds} } || 0)
+ (eval { $a->topmost->{ds} } || 0) <=>
+ (eval { $b->topmost->{ds} } || 0)
} @{$_[0]} ];
}
# accumulate recent topics if search is supported
# returns 200 if done, 404 if not
sub acc_topic { # walk_thread callback
- my ($ctx, $level, $node) = @_;
- my $mid = $node->{id};
- my $smsg = $node->{smsg} // $ctx->{-inbox}->smsg_by_mid($mid);
- if ($smsg) {
+ my ($ctx, $level, $smsg) = @_;
+ my $mid = $smsg->{mid};
+ my $has_blob = $smsg->{blob} // do {
+ if (my $by_mid = $ctx->{-inbox}->smsg_by_mid($mid)) {
+ %$smsg = (%$smsg, %$by_mid);
+ 1;
+ }
+ };
+ if ($has_blob) {
my $subj = subject_normalized($smsg->{subject});
$subj = '(no subject)' if $subj eq '';
my $ds = $smsg->{ds};
@@ -1214,7 +1211,7 @@ sub thread_adj_level {
sub ghost_index_entry {
my ($ctx, $level, $node) = @_;
my ($beg, $end) = thread_adj_level($ctx, $level);
- $beg . ''. ghost_parent($ctx->{-upfx}, $node->{id})
+ $beg . ''. ghost_parent($ctx->{-upfx}, $node->{mid})
. '
' . $end;
}