about summary refs log tree commit homepage
path: root/lib
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2015-08-17 02:41:13 +0000
committerEric Wong <e@80x24.org>2015-08-17 03:13:35 +0000
commit395b6a9e8d4815708208c19c5b9a488c09f41c4f (patch)
treeac2194b0d0a51d75eb473cf0f2bcfb3e513aef83 /lib
parent41947542045105aaa6f500f44de17de775e45a0b (diff)
downloadpublic-inbox-395b6a9e8d4815708208c19c5b9a488c09f41c4f.tar.gz
terminology: replies => followups
Replies are only direct replies, but followups could be any message
further down the thread.  The latter is more useful.
Diffstat (limited to 'lib')
-rw-r--r--lib/PublicInbox/Search.pm4
-rw-r--r--lib/PublicInbox/View.pm28
2 files changed, 19 insertions, 13 deletions
diff --git a/lib/PublicInbox/Search.pm b/lib/PublicInbox/Search.pm
index f4f00b25..6fd46f44 100644
--- a/lib/PublicInbox/Search.pm
+++ b/lib/PublicInbox/Search.pm
@@ -218,8 +218,8 @@ sub get_subject_path {
         $self->do_enquire($query);
 }
 
-# given a message ID, get replies to a message
-sub get_replies {
+# given a message ID, get followups to a message
+sub get_followups {
         my ($self, $mid, $opts) = @_;
         $mid = mid_clean($mid);
         $mid = mid_compressed($mid);
diff --git a/lib/PublicInbox/View.pm b/lib/PublicInbox/View.pm
index 49609351..4f2833b3 100644
--- a/lib/PublicInbox/View.pm
+++ b/lib/PublicInbox/View.pm
@@ -133,7 +133,8 @@ sub index_entry {
         }
 
         if ($srch) {
-                $rv .= " <a\nhref=\"${path}t/$href.html$t_anchor\">thread</a>";
+                $rv .= " <a\nhref=\"${path}t/$href.html$t_anchor\">" .
+                       "threadlink</a>";
         }
 
         $rv . "\n\n";
@@ -154,7 +155,14 @@ sub thread_html {
         my $state = [ $srch, { root_anchor => anchor_for($mid) }, undef, 0 ];
         thread_entry(\$rv, $state, $_, 0) for $th->rootset;
         my $final_anchor = $state->[3];
-        my $next = "<a\nid=\"s$final_anchor\">end of thread</a>\n";
+        my $next = "<a\nid=\"s$final_anchor\">";
+
+        if ($final_anchor == 1) {
+                $next .= 'only message in thread';
+        } else {
+                $next .= 'end of thread';
+        }
+        $next .= ", back to <a\nhref=\"../\">index</a>\n";
 
         $rv .= "</pre><hr />" . PRE_WRAP . $next . $foot . "</pre>";
 }
@@ -432,14 +440,15 @@ sub html_footer {
                 $irt = $mime->header_obj->header_raw('In-Reply-To') || '';
                 $mid = mid_compressed(mid_clean($mid));
                 my $t_anchor = length $irt ? T_ANCHOR : '';
-                $idx = " <a\nhref=\"../t/$mid.html$t_anchor\">thread</a>$idx";
-                my $res = $srch->get_replies($mid);
+                $idx = " <a\nhref=\"../t/$mid.html$t_anchor\">".
+                       "threadlink</a>$idx";
+                my $res = $srch->get_followups($mid);
                 if (my $c = $res->{count}) {
-                        $c = $c == 1 ? '1 reply' : "$c replies";
+                        $c = $c == 1 ? '1 followup' : "$c followups";
                         $idx .= "\n$c:\n";
-                        thread_replies(\$idx, $mime, $res);
+                        thread_followups(\$idx, $mime, $res);
                 } else {
-                        $idx .= "\n(no replies yet)\n";
+                        $idx .= "\n(no followups, yet)\n";
                 }
                 if ($irt) {
                         $irt = PublicInbox::Hval->new_msgid($irt);
@@ -512,12 +521,9 @@ sub hash_subj {
         Digest::SHA::sha1($subj);
 }
 
-sub thread_replies {
+sub thread_followups {
         my ($dst, $root, $res) = @_;
         my @msgs = map { $_->mini_mime } @{$res->{msgs}};
-        foreach (@{$res->{msgs}}) {
-                print STDERR "smsg->path: <", $_->path, ">\n";
-        }
         require PublicInbox::Thread;
         $root->header_set('X-PI-TS', '0');
         my $th = PublicInbox::Thread->new($root, @msgs);