lib/PublicInbox/LeiViewText.pm | 14 ++++++++------ diff --git a/lib/PublicInbox/LeiViewText.pm b/lib/PublicInbox/LeiViewText.pm index 6f5fca492bc224b10ff4f03011002098b86ad480..5d649840e595296a4ef6d9696d585e2d18eb7b65 100644 --- a/lib/PublicInbox/LeiViewText.pm +++ b/lib/PublicInbox/LeiViewText.pm @@ -25,6 +25,7 @@ # mutt names, loaded from ~/.config/lei/config quoted => 'blue', hdrdefault => 'cyan', status => 'bright_cyan', # smsg stuff + attachment => 'bright_red', # git names and defaults, falls back to ~/.gitconfig new => 'green', @@ -113,20 +114,21 @@ sub attach_note ($$$$;$) { my ($self, $ct, $p, $fn, $err) = @_; my ($part, $depth, $idx) = @$p; - my $obuf = $self->{obuf}; my $nl = $idx eq '1' ? '' : "\n"; # like join("\n", ...) - $$obuf .= <{-smsg}->{blob} // ''; - $blob .= ':' if $blob ne ''; - $$obuf .= "[-- Attachment $blob$idx "; + $abuf .= "[-- Attachment #$idx: "; _xs($ct); my $size = length($part->body); my $ts = "Type: $ct, Size: $size bytes"; my $d = $part->header('Content-Description') // $fn // ''; _xs($d); - $$obuf .= $d eq '' ? "$ts --]\n" : "$d --]\n[-- $ts --]\n"; + $abuf .= $d eq '' ? "$ts --]\n" : "$d --]\n[-- $ts --]\n"; + if (my $blob = $self->{-smsg}->{blob}) { + $abuf .= "[-- lei blob $blob:$idx --]\n"; + } + $self->{-colored}->($self, 'attachment', $abuf); hdr_buf($self, $part) if $part->{is_submsg}; }