user/dev discussion of public-inbox itself
 help / color / mirror / code / Atom feed
Search results ordered by [date|relevance]  view[summary|nested|Atom feed]
thread overview below | download mbox.gz: |
* [PATCH 9/9] view: fix broken link to ghost fallback
    2015-09-04  8:58  5% ` [PATCH 4/9] view: add missing newline to inline dump Eric Wong
@ 2015-09-04  8:58  5% ` Eric Wong
  1 sibling, 0 replies; 3+ results
From: Eric Wong @ 2015-09-04  8:58 UTC (permalink / raw)
  To: meta

Once again, the regression was introduced in
commit 16ca6b7a57266fcb466ffff005bc1d644bad14c1
(view: avoid attempting to find "subject dummy")
---
 lib/PublicInbox/View.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/PublicInbox/View.pm b/lib/PublicInbox/View.pm
index ea31364..df2de40 100644
--- a/lib/PublicInbox/View.pm
+++ b/lib/PublicInbox/View.pm
@@ -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>');
 		}
 	}
-- 
EW


^ permalink raw reply related	[relevance 5%]

* [PATCH 4/9] view: add missing newline to inline dump
  @ 2015-09-04  8:58  5% ` Eric Wong
  2015-09-04  8:58  5% ` [PATCH 9/9] view: fix broken link to ghost fallback Eric Wong
  1 sibling, 0 replies; 3+ results
From: Eric Wong @ 2015-09-04  8:58 UTC (permalink / raw)
  To: meta

This fixes a regression introduced in
commit 16ca6b7a57266fcb466ffff005bc1d644bad14c1
(view: avoid attempting to find "subject dummy")
---
 lib/PublicInbox/View.pm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/PublicInbox/View.pm b/lib/PublicInbox/View.pm
index c53e2e1..6b71703 100644
--- a/lib/PublicInbox/View.pm
+++ b/lib/PublicInbox/View.pm
@@ -738,8 +738,8 @@ sub inline_dump {
 		}
 		_inline_header($dst, $state, $upfx, $mime, $level);
 	} else {
-		my $pfx = INDENT x $level;
-		$$dst .= $pfx . '` ' . ghost_parent($upfx, $node->messageid);
+		my $pfx = (INDENT x $level) . '` ';
+		$$dst .= $pfx . ghost_parent($upfx, $node->messageid) . "\n";
 	}
 	inline_dump($dst, $state, $upfx, $node->child, $level+1);
 	inline_dump($dst, $state, $upfx, $node->next, $level);
-- 
EW


^ permalink raw reply related	[relevance 5%]

* [PATCH 5/7] view: avoid attempting to find "subject dummy"
  @ 2015-09-04  2:18  7% ` Eric Wong
  0 siblings, 0 replies; 3+ results
From: Eric Wong @ 2015-09-04  2:18 UTC (permalink / raw)
  To: meta

This is an internal Message-ID used by Mail::Thread, to group
messages with identical subjects but common parent.  Don't
attempt to redirect users to external sites when we cannot
find it.
---
 lib/PublicInbox/View.pm | 31 ++++++++++++++++---------------
 1 file changed, 16 insertions(+), 15 deletions(-)

diff --git a/lib/PublicInbox/View.pm b/lib/PublicInbox/View.pm
index 68adbd7..65ef1e7 100644
--- a/lib/PublicInbox/View.pm
+++ b/lib/PublicInbox/View.pm
@@ -591,6 +591,17 @@ sub pre_anchor_entry {
 	$seen->{$id} = "#$id"; # save the anchor for children, later
 }
 
+sub ghost_parent {
+	my ($upfx, $mid) = @_;
+	# 'subject dummy' is used internally by Mail::Thread
+	return '[no common parent]' if ($mid eq 'subject dummy');
+
+	$mid = PublicInbox::Hval->new_msgid($mid);
+	my $href = $mid->as_href;
+	my $html = $mid->as_html;
+	qq{[parent not found: &lt;<a\nhref="$upfx../$href/">$html</a>&gt;]};
+}
+
 sub __thread_entry {
 	my ($cb, $git, $state, $mime, $level) = @_;
 
@@ -607,15 +618,10 @@ sub __thread_entry {
 	if (my $ghost = delete $state->{ghost}) {
 		# n.b. ghost messages may only be parents, not children
 		foreach my $g (@$ghost) {
-			my $mid = PublicInbox::Hval->new_msgid($g->[0]);
-			my $pfx = INDENT x $g->[1];
-			my $href = $mid->as_href;
-			my $html = $mid->as_html;
-			$$cb->write("<table><tr><td>$pfx</td><td>" .
-					PRE_WRAP .
-					'[parent not found: &lt;' .
-					qq{<a\nhref="../../$href/">}.
-					"$html</a>&gt;]</pre></td></table>");
+			$$cb->write("<table\nsummary=ghost><tr><td>" .
+				(INDENT x $g->[1]) . "</td><td>" .
+				PRE_WRAP . ghost_parent('', $g->[0]) .
+				'</pre></td></table>');
 		}
 	}
 	index_entry($$cb, $mime, $level, $state);
@@ -736,12 +742,7 @@ sub inline_dump {
 		_inline_header($dst, $state, $upfx, $mime, $level);
 	} else {
 		my $pfx = INDENT x $level;
-		my $v = PublicInbox::Hval->new_msgid($node->messageid, 1);
-		my $html = $v->as_html;
-		my $href = $v->as_href;
-		$$dst .= $pfx . '` [parent not found: &lt;' .
-				qq{<a\nhref="$upfx../$href/">}.
-				"$html</a>&gt;]\n";
+		$$dst .= $pfx . '` ' . ghost_parent($upfx, $node->messageid);
 	}
 	inline_dump($dst, $state, $upfx, $node->child, $level+1);
 	inline_dump($dst, $state, $upfx, $node->next, $level);
-- 
EW


^ permalink raw reply related	[relevance 7%]

Results 1-3 of 3 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2015-09-04  2:18     [PATCH 0/7] new index and misc fixes Eric Wong
2015-09-04  2:18  7% ` [PATCH 5/7] view: avoid attempting to find "subject dummy" Eric Wong
2015-09-04  8:58     [PATCH 0/9] another round of updates Eric Wong
2015-09-04  8:58  5% ` [PATCH 4/9] view: add missing newline to inline dump Eric Wong
2015-09-04  8:58  5% ` [PATCH 9/9] view: fix broken link to ghost fallback Eric Wong

Code repositories for project(s) associated with this public inbox

	https://80x24.org/public-inbox.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).