about summary refs log tree commit
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2019-04-18 23:31:46 +0000
committerEric Wong <e@80x24.org>2019-04-18 23:35:20 +0000
commitf94c3a195a25a31d0215cd175938008fca473378 (patch)
treee0f97de2cd596046505e05d76fe9e2588c792182
parentf1877b77595bd88cc74ef0ed58ca1f0ae5adc0e4 (diff)
downloadpublic-inbox-f94c3a195a25a31d0215cd175938008fca473378.tar.gz
Empty subjects ("") and undefined Subjects: are now both
displayed as "(no subject)" for now.
-rw-r--r--lib/PublicInbox/SearchView.pm1
-rw-r--r--lib/PublicInbox/View.pm3
2 files changed, 4 insertions, 0 deletions
diff --git a/lib/PublicInbox/SearchView.pm b/lib/PublicInbox/SearchView.pm
index 7ef6b075..3b3afdee 100644
--- a/lib/PublicInbox/SearchView.pm
+++ b/lib/PublicInbox/SearchView.pm
@@ -120,6 +120,7 @@ sub mset_summary {
                 }
                 my $date = PublicInbox::View::fmt_ts($smsg->ds);
                 my $mid = PublicInbox::Hval->new_msgid($smsg->mid)->{href};
+                $s = '(no subject)' if $s eq '';
                 $$res .= qq{$rank. <b><a\nhref="$mid/">}.
                         $s . "</a></b>\n";
                 $$res .= "$pfx  - by $f @ $date UTC [$pct%]\n\n";
diff --git a/lib/PublicInbox/View.pm b/lib/PublicInbox/View.pm
index f94daaf2..62bdf0a1 100644
--- a/lib/PublicInbox/View.pm
+++ b/lib/PublicInbox/View.pm
@@ -213,6 +213,7 @@ sub index_entry {
         my $irt;
         my $obfs_ibx = $ctx->{-obfs_ibx};
 
+        $subj = '(no subject)' if $subj eq '';
         my $rv = "<a\nhref=#e$id\nid=m$id>*</a> ";
         $subj = '<b>'.ascii_html($subj).'</b>';
         obfuscate_addrs($obfs_ibx, $subj) if $obfs_ibx;
@@ -729,6 +730,7 @@ sub thread_skel {
 
         my $subj = $hdr->header('Subject');
         defined $subj or $subj = '';
+        $subj = '(no subject)' if $subj eq '';
         $ctx->{prev_subj} = [ split(/ /, $srch->subject_normalized($subj)) ];
         $ctx->{cur} = $mid;
         $ctx->{prev_attr} = '';
@@ -1039,6 +1041,7 @@ sub acc_topic {
         if ($x) {
                 $subj = $x->subject;
                 $subj = $srch->subject_normalized($subj);
+                $subj = '(no subject)' if $subj eq '';
                 $ds = $x->ds;
                 if ($level == 0) {
                         $topic = [ $ds, 1, { $subj => $mid }, $subj ];