X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=lib%2FPublicInbox%2FView.pm;h=65d7d019b3018d40f1880b9d7e4bfe62722cfe7c;hb=bb23f834ec0510d5318e59620100b0046f044f34;hp=41f1321e4251e6c80e322c3dd69004b3c9524b4f;hpb=0d48c3d9b83393337b20ed50aa7847c0a7e6b506;p=public-inbox.git diff --git a/lib/PublicInbox/View.pm b/lib/PublicInbox/View.pm index 41f1321e..65d7d019 100644 --- a/lib/PublicInbox/View.pm +++ b/lib/PublicInbox/View.pm @@ -61,7 +61,8 @@ sub msg_reply { $info = qq(\n List information: $url\n); } - my ($arg, $link) = PublicInbox::Reply::mailto_arg_link($ibx, $hdr); + my ($arg, $link, $reply_to_all) = + PublicInbox::Reply::mailto_arg_link($ibx, $hdr); # mailto: link only works if address obfuscation is disabled if ($link) { @@ -69,9 +70,10 @@ sub msg_reply { * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link +href="$link">mailto: link EOF } + push @$arg, '/path/to/YOUR_REPLY'; $arg = ascii_html(join(" \\\n ", '', @$arg)); <this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, - and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: $p_url $info -* Reply to all the recipients using the --to, --cc, - and --in-reply-to switches of git-send-email(1): +* Reply using the --to, --cc, and --in-reply-to + switches of git-send-email(1): git send-email$arg $se_url -$link +$link EOF } @@ -574,26 +576,27 @@ sub thread_skel { my $mid = mid_clean($hdr->header_raw('Message-ID')); my $sres = $srch->get_thread($mid); my $nr = $sres->{total}; - my $expand = qq(expand ) . - qq(/ mbox.gz ) . - qq(/ Atom feed); + my $expand = qq(expand[flat) . + qq(|nested] ) . + qq(mbox.gz ) . + qq(Atom feed); my $parent = in_reply_to($hdr); $$dst .= "\nThread overview: "; if ($nr <= 1) { if (defined $parent) { - $$dst .= "($expand)\n "; + $$dst .= "$expand\n "; $$dst .= ghost_parent("$tpfx../", $parent) . "\n"; } else { - $$dst .= "[no followups, yet] ($expand)\n"; + $$dst .= "[no followups] $expand\n"; } $ctx->{next_msg} = undef; $ctx->{parent_msg} = $parent; return; } - $$dst .= "$nr+ messages in thread ($expand"; - $$dst .= qq! / [top])\n!; + $$dst .= "$nr+ messages / $expand"; + $$dst .= qq! top\n!; my $subj = $hdr->header('Subject'); defined $subj or $subj = ''; @@ -755,6 +758,25 @@ sub _msg_date { sub fmt_ts { POSIX::strftime('%Y-%m-%d %k:%M', gmtime($_[0])) } +sub dedupe_subject { + my ($prev_subj, $subj, $val) = @_; + + my $omit = ''; # '"' denotes identical text omitted + my (@prev_pop, @curr_pop); + while (@$prev_subj && @$subj && $subj->[-1] eq $prev_subj->[-1]) { + push(@prev_pop, pop(@$prev_subj)); + push(@curr_pop, pop(@$subj)); + $omit ||= $val; + } + pop @$subj if @$subj && $subj->[-1] =~ /^re:\s*/i; + if (scalar(@curr_pop) == 1) { + $omit = ''; + push @$prev_subj, @prev_pop; + push @$subj, @curr_pop; + } + $omit; +} + sub skel_dump { my ($ctx, $level, $node) = @_; my $smsg = $node->{smsg} or return _skel_ghost($ctx, $level, $node); @@ -798,13 +820,7 @@ sub skel_dump { # so we do not show redundant text at the end. my $prev_subj = $ctx->{prev_subj} || []; $ctx->{prev_subj} = [ @subj ]; - my $omit = ''; # '"' denotes identical text omitted - while (@$prev_subj && @subj && $subj[-1] eq $prev_subj->[-1]) { - pop @$prev_subj; - pop @subj; - $omit ||= '" '; - } - pop @subj if @subj && $subj[-1] =~ /^re:\s*/i; + my $omit = dedupe_subject($prev_subj, \@subj, '" '); my $end; if (@subj) { my $subj = join(' ', @subj); @@ -944,14 +960,7 @@ sub dump_topics { $mid = delete $seen->{$subj}; my @subj = split(/ /, $srch->subject_normalized($subj)); my @next_prev = @subj; # full copy - my $omit = ''; # '"' denotes identical text omitted - while (@$prev_subj && @subj && - $subj[-1] eq $prev_subj->[-1]) { - pop @$prev_subj; - pop @subj; - $omit ||= ' "'; - } - pop @subj if @subj && $subj[-1] =~ /^re:\s*/i; + my $omit = dedupe_subject($prev_subj, \@subj, ' "'); $prev_subj = \@next_prev; $subj = ascii_html(join(' ', @subj)); obfuscate_addrs($obfs_ibx, $subj) if $obfs_ibx;