unofficial mirror of meta@public-inbox.org
 help / color / mirror / Atom feed
* [PATCH] view: shorter link for ghosts in per-message view
@ 2016-04-06  8:08 Eric Wong
  2016-04-06  8:26 ` [PATCH] view: account for threads lacking a common parent Eric Wong
  0 siblings, 1 reply; 2+ messages in thread
From: Eric Wong @ 2016-04-06  8:08 UTC (permalink / raw)
  To: meta

Shorten lines used for long Message-IDs in the
inline thread view for per-message views for readability.
---
 lib/PublicInbox/View.pm | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/lib/PublicInbox/View.pm b/lib/PublicInbox/View.pm
index 5f9ecd1..c25c5d5 100644
--- a/lib/PublicInbox/View.pm
+++ b/lib/PublicInbox/View.pm
@@ -820,10 +820,12 @@ sub inline_dump {
 		_inline_header($dst, $state, $upfx, $hdr, $level);
 	} else {
 		my $dot = $level == 0 ? '' : '` ';
-		my $pfx = (' ' x length(' 1970-01-01 13:37 ')).
-			indent_for($level) . $dot;
+		my $pfx = '      [not found] ' .  indent_for($level) . $dot;
 		$$dst .= $pfx;
-		$$dst .= ghost_parent("$upfx../", $node->messageid) . "\n";
+		my $mid = PublicInbox::Hval->new_msgid($node->messageid);
+		my $href = $mid->as_href;
+		my $html = $mid->as_html;
+		$$dst .= qq{&lt;<a\nhref="$upfx../$href/">$html</a>&gt;\n};
 	}
 	inline_dump($dst, $state, $upfx, $node->child, $level+1);
 	inline_dump($dst, $state, $upfx, $node->next, $level);
-- 
EW


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [PATCH] view: account for threads lacking a common parent
  2016-04-06  8:08 [PATCH] view: shorter link for ghosts in per-message view Eric Wong
@ 2016-04-06  8:26 ` Eric Wong
  0 siblings, 0 replies; 2+ messages in thread
From: Eric Wong @ 2016-04-06  8:26 UTC (permalink / raw)
  To: meta; +Cc: Eric Wong

In the per-message view, we still need to account for threads
lacking a common parent.  This can happen when threads are
broken by some broken clients or if somebody sends the same
message twice to the same inbox with a different Message-ID.
---
 lib/PublicInbox/View.pm | 19 ++++++++++++-------
 1 file changed, 12 insertions(+), 7 deletions(-)

diff --git a/lib/PublicInbox/View.pm b/lib/PublicInbox/View.pm
index c25c5d5..070240e 100644
--- a/lib/PublicInbox/View.pm
+++ b/lib/PublicInbox/View.pm
@@ -819,13 +819,18 @@ sub inline_dump {
 		my $mid = mid_clean($hdr->header_raw('Message-ID'));
 		_inline_header($dst, $state, $upfx, $hdr, $level);
 	} else {
-		my $dot = $level == 0 ? '' : '` ';
-		my $pfx = '      [not found] ' .  indent_for($level) . $dot;
-		$$dst .= $pfx;
-		my $mid = PublicInbox::Hval->new_msgid($node->messageid);
-		my $href = $mid->as_href;
-		my $html = $mid->as_html;
-		$$dst .= qq{&lt;<a\nhref="$upfx../$href/">$html</a>&gt;\n};
+		my $mid = $node->messageid;
+		if ($mid eq 'subject dummy') {
+			$$dst .= "\t[no common parent]\n";
+		} else {
+			$$dst .= '      [not found] ';
+			my $dot = $level == 0 ? '' : '` ';
+			$$dst .= indent_for($level) . $dot;
+			$mid = PublicInbox::Hval->new_msgid($mid);
+			my $href = "$upfx../" . $mid->as_href . '/';
+			my $html = $mid->as_html;
+			$$dst .= qq{&lt;<a\nhref="$href">$html</a>&gt;\n};
+		}
 	}
 	inline_dump($dst, $state, $upfx, $node->child, $level+1);
 	inline_dump($dst, $state, $upfx, $node->next, $level);
-- 
EW


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-04-06  8:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-06  8:08 [PATCH] view: shorter link for ghosts in per-message view Eric Wong
2016-04-06  8:26 ` [PATCH] view: account for threads lacking a common parent Eric Wong

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).