sub flush_quote {
my ($quot, $n, $part_nr, $full_pfx, $final, $do_anchor) = @_;
+ # n.b.: do not use <blockquote> since it screws up alignment
+ # w.r.t. unquoted text. Repliers may rely on pre-formatted
+ # alignment to point out a certain word in quoted text.
if ($full_pfx) {
if (!$final && scalar(@$quot) <= MAX_INLINE_QUOTED) {
# show quote inline
$$dst .= 'Thread: ';
my $parent = in_reply_to($cur);
if ($nr <= 1) {
- $$dst .= "[no followups, yet] ($expand)\n";
+ if (defined $parent) {
+ $$dst .= "($expand)\n ";
+ $$dst .= ghost_parent("$upfx../", $parent) . "\n";
+ } else {
+ $$dst .= "[no followups, yet] ($expand)\n";
+ }
$ctx->{next_msg} = undef;
$ctx->{parent_msg} = $parent;
return;
}
- $$dst .= "~$nr messages (<a\nhref=\"#b\">skip</a> / " .
- $expand . ")\n";
+ $$dst .= "~$nr messages ($expand";
+ if ($nr > MAX_INLINE_QUOTED) {
+ $$dst .= qq! / <a\nhref="#b">[scroll down]</a>!;
+ }
+ $$dst .= ")\n";
my $subj = $srch->subject_path($cur->header('Subject'));
my $state = {
my $f = $mime->header('X-PI-From');
my $d = _msg_date($mime);
$f = PublicInbox::Hval->new_oneline($f)->as_html;
- $d = PublicInbox::Hval->new_oneline($d)->as_html;
my $pfx = ' ' . $d . ' ' . indent_for($level);
my $attr = $f;
$state->{first_level} ||= $level;
if (my $x = $node->message) {
$x = $x->header_obj;
- my ($topic, $subj);
+ my $subj;
$subj = $x->header('Subject');
$subj = $state->{srch}->subject_normalized($subj);
- $topic = $subj;
-
- # kill "[PATCH v2]" etc. for summarization
- unless ($level == 0) {
- $topic =~ s/\A\s*\[[^\]]+\]\s*//g;
- }
- if (++$state->{subjs}->{$topic} == 1) {
- push @{$state->{order}}, [ $level, $subj, $topic ];
+ if (++$state->{subjs}->{$subj} == 1) {
+ push @{$state->{order}}, [ $level, $subj ];
}
my $mid = mid_clean($x->header('Message-ID'));
my $ts = $x->header('X-PI-TS');
- my $exist = $state->{latest}->{$topic};
+ my $exist = $state->{latest}->{$subj};
if (!$exist || $exist->[1] < $ts) {
- $state->{latest}->{$topic} = [ $mid, $ts ];
+ $state->{latest}->{$subj} = [ $mid, $ts ];
}
} else {
# ghost message, do not bump level
my $prev = 0;
my $prev_attr = '';
while (defined(my $info = shift @$order)) {
- my ($level, $subj, $topic) = @$info;
- my $n = delete $subjs->{$topic};
- my ($mid, $ts) = @{delete $latest->{$topic}};
+ my ($level, $subj) = @$info;
+ my $n = delete $subjs->{$subj};
+ my ($mid, $ts) = @{delete $latest->{$subj}};
$mid = PublicInbox::Hval->new_msgid($mid)->as_href;
$subj = PublicInbox::Hval->new($subj)->as_html;
$pfx = indent_for($level);