about summary refs log tree commit homepage
path: root/lib/PublicInbox/View.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2016-02-08 11:20:59 +0000
committerEric Wong <e@80x24.org>2016-02-08 11:20:59 +0000
commitfe9c93dbd71f903194c2fd3c22ccd57e31042013 (patch)
treeb99220f48277be6e1f0cc3eb3cd0a3fcf5429697 /lib/PublicInbox/View.pm
parenta599fed57ab19616feb803b109fc0a0802f1304c (diff)
downloadpublic-inbox-fe9c93dbd71f903194c2fd3c22ccd57e31042013.tar.gz
Dropping "[FOO]" prefixes for the purposes of summarization
is tricky and we end up with odd display behavior.
Just show Subject line changes as the writer intended
(with the exception of normalization to strip the "Re: ")
Diffstat (limited to 'lib/PublicInbox/View.pm')
-rw-r--r--lib/PublicInbox/View.pm22
1 files changed, 8 insertions, 14 deletions
diff --git a/lib/PublicInbox/View.pm b/lib/PublicInbox/View.pm
index 70b92a7c..fc877b7c 100644
--- a/lib/PublicInbox/View.pm
+++ b/lib/PublicInbox/View.pm
@@ -867,27 +867,21 @@ sub add_topic {
 
         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
@@ -909,9 +903,9 @@ sub dump_topics {
         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);