]> Sergey Matveev's repositories - public-inbox.git/commitdiff
view: consistent links for per-message views
authorEric Wong <e@80x24.org>
Wed, 2 Dec 2015 02:47:00 +0000 (02:47 +0000)
committerEric Wong <e@80x24.org>
Wed, 2 Dec 2015 02:47:00 +0000 (02:47 +0000)
Just because a message is currently alone does not mean
the links won't be valid in the future when more messages
show up.

lib/PublicInbox/View.pm

index a3a955b2b520515340e57f4bee289cad4ab147f6..d8fb1cb5ba0b95761ed4924725bcdd54d59d68a5 100644 (file)
@@ -463,15 +463,17 @@ sub thread_inline {
        my $mid = mid_clean($cur->header('Message-ID'));
        my $res = $srch->get_thread($mid);
        my $nr = $res->{total};
+       my $upfx = $full_pfx ? '' : '../';
+       my $expand = "(<a\nhref=\"${upfx}t/#u\">expand</a> " .
+                       "/ <a\nhref=\"${upfx}t.mbox.gz\">mbox.gz</a>)";
 
        if ($nr <= 1) {
-               $$dst .= "\n[no followups, yet]\n";
+               $$dst .= "\n[no followups, yet] $expand\n";
                return (undef, in_reply_to($cur));
        }
-       my $upfx = $full_pfx ? '' : '../';
 
-       $$dst .= "\n\n~$nr messages in thread: ".
-                "(<a\nhref=\"${upfx}t/#u\">expand</a>)\n";
+       $$dst .= "\n\n~$nr messages in thread: $expand\n";
+
        my $subj = $srch->subject_path($cur->header('Subject'));
        my $parent = in_reply_to($cur);
        my $state = {