]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/View.pm
update copyright headers and email addresses
[public-inbox.git] / lib / PublicInbox / View.pm
index 4e800c685b7724fa6e76a47b55d8af280b1aa4c4..8969e17576f60de54152ebb2d4502571610801ef 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (C) 2014, Eric Wong <normalperson@yhbt.net> and all contributors
+# Copyright (C) 2014-2015 all contributors <meta@public-inbox.org>
 # License: AGPLv3 or later (https://www.gnu.org/licenses/agpl-3.0.txt)
 package PublicInbox::View;
 use strict;
@@ -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;
        }
@@ -620,7 +620,7 @@ sub __thread_entry {
                foreach my $g (@$ghost) {
                        $$cb->write("<table\nsummary=ghost><tr><td>" .
                                (INDENT x $g->[1]) . "</td><td>" .
-                               PRE_WRAP . ghost_parent('', $g->[0]) .
+                               PRE_WRAP . ghost_parent('../', $g->[0]) .
                                '</pre></td></table>');
                }
        }