diff options
author | Eric Wong <e@80x24.org> | 2015-09-03 03:00:28 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2015-09-03 03:06:00 +0000 |
commit | 43238d3688a51d98ce47151173aa7971e231a3bb (patch) | |
tree | b1fc31be8763eefcc2393d1fa44ad75581059fa1 /lib/PublicInbox/View.pm | |
parent | 793da75fbcb5a2c546b3d582f39761fff3d8292d (diff) | |
download | public-inbox-43238d3688a51d98ce47151173aa7971e231a3bb.tar.gz |
Provide a fallback for legacy SHA-1 messages, but do not advertise shorter URLs anymore for data portability concerns. This fixes a regression introduced in commit 81a9c1b476987d845b340ab9013d26cf4487cb9a ("search: disable Message-ID compression in Xapian") which ended up breaking thread-related endpoints for large Message-IDs, as lookups on the SHA-1 message no longer worked.
Diffstat (limited to 'lib/PublicInbox/View.pm')
-rw-r--r-- | lib/PublicInbox/View.pm | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/lib/PublicInbox/View.pm b/lib/PublicInbox/View.pm index c572198a..129aa895 100644 --- a/lib/PublicInbox/View.pm +++ b/lib/PublicInbox/View.pm @@ -161,7 +161,7 @@ sub thread_html { sub emit_thread_html { my ($cb, $ctx, $foot, $srch) = @_; - my $mid = mid_compress($ctx->{mid}); + my $mid = $ctx->{mid}; my $res = $srch->get_thread($mid); my $msgs = load_results($res); my $nr = scalar @$msgs; @@ -447,7 +447,7 @@ sub headers_to_html_header { sub thread_inline { my ($dst, $ctx, $cur, $full_pfx) = @_; my $srch = $ctx->{srch}; - my $mid = mid_compress(mid_clean($cur->header('Message-ID'))); + my $mid = mid_clean($cur->header('Message-ID')); my $res = $srch->get_thread($mid); my $nr = $res->{total}; @@ -465,7 +465,7 @@ sub thread_inline { seen => { $subj => 1 }, srch => $srch, cur => $mid, - parent_cmp => $parent ? mid_compress($parent) : '', + parent_cmp => defined $parent ? $parent : '', parent => $parent, }; for (thread_results(load_results($res))->rootset) { @@ -683,16 +683,15 @@ sub _inline_header { my $pfx = INDENT x $level; my $cur = $state->{cur}; - my $mid = $mime->header('Message-ID'); + my $mid = mid_clean($mime->header('Message-ID')); my $f = $mime->header('X-PI-From'); my $d = _msg_date($mime); $f = PublicInbox::Hval->new($f); $d = PublicInbox::Hval->new($d); $f = $f->as_html; $d = $d->as_html . ' UTC'; - my $midc = mid_compress(mid_clean($mid)); if ($cur) { - if ($cur eq $midc) { + if ($cur eq $mid) { delete $state->{cur}; $$dst .= "$pfx` <b><a\nid=\"r\"\nhref=\"#t\">". "[this message]</a></b> by $f @ $d\n"; @@ -700,7 +699,7 @@ sub _inline_header { return; } } else { - $state->{next_msg} ||= $midc; + $state->{next_msg} ||= $mid; } # Subject is never undef, this mail was loaded from |