From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-2.9 required=3.0 tests=ALL_TRUSTED,AWL,BAYES_00, RP_MATCHES_RCVD shortcircuit=no autolearn=unavailable version=3.3.2 X-Original-To: meta@public-inbox.org Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id E62936338DC for ; Fri, 4 Sep 2015 08:59:03 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 7/9] view: thread view expands focused message Date: Fri, 4 Sep 2015 08:58:57 +0000 Message-Id: <1441357139-23879-8-git-send-email-e@80x24.org> In-Reply-To: <1441357139-23879-1-git-send-email-e@80x24.org> References: <1441357139-23879-1-git-send-email-e@80x24.org> List-Id: Non-top-level messages still deserve to be shown in full if they're the message in the URL. --- lib/PublicInbox/View.pm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/PublicInbox/View.pm b/lib/PublicInbox/View.pm index 4e800c6..ea31364 100644 --- a/lib/PublicInbox/View.pm +++ b/lib/PublicInbox/View.pm @@ -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 = "$subj"; } - if ($root_anchor && $root_anchor eq $id) { + if ($root_anchor eq $id) { $subj = "$subj"; } @@ -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; } -- EW