]> Sergey Matveev's repositories - public-inbox.git/commitdiff
view: thread view expands focused message
authorEric Wong <e@80x24.org>
Fri, 4 Sep 2015 08:27:45 +0000 (08:27 +0000)
committerEric Wong <e@80x24.org>
Fri, 4 Sep 2015 08:28:45 +0000 (08:28 +0000)
Non-top-level messages still deserve to be shown in full
if they're the message in the URL.

lib/PublicInbox/View.pm

index 4e800c685b7724fa6e76a47b55d8af280b1aa4c4..ea313644979a835350ff022dad5f946ab19722d5 100644 (file)
@@ -85,7 +85,7 @@ sub index_entry {
        $from = PublicInbox::Hval->new_oneline($from)->as_html;
        $subj = PublicInbox::Hval->new_oneline($subj)->as_html;
        my $more = 'permalink';
-       my $root_anchor = $state->{root_anchor};
+       my $root_anchor = $state->{root_anchor} || '';
        my $path = $root_anchor ? '../../' : '';
        my $href = $mid->as_href;
        my $irt = in_reply_to($header_obj);
@@ -95,7 +95,7 @@ sub index_entry {
                my $t = $ctx->{flat} ? 'T' : 't';
                $subj = "<a\nhref=\"${path}$href/$t/#u\">$subj</a>";
        }
-       if ($root_anchor && $root_anchor eq $id) {
+       if ($root_anchor eq $id) {
                $subj = "<u\nid=\"u\">$subj</u>";
        }
 
@@ -116,8 +116,8 @@ sub index_entry {
        my ($fhref, $more_ref);
        my $mhref = "${path}$href/";
 
-       # show full messages at level == 0 in threaded view
-       if ($level > 0 || ($ctx->{flat} && $root_anchor ne $id)) {
+       # show full message if it's our root message
+       if ($root_anchor ne $id) {
                $fhref = "${path}$href/f/";
                $more_ref = \$more;
        }