-# Redirect to another public-inbox which is mapped by $pi_config
-sub r302 {
- my ($url, $mid) = @_;
- $url .= '/' . uri_escape_utf8($mid) . '/';
- [ 302,
- [ 'Location' => $url, 'Content-Type' => 'text/plain' ],
- [ "Redirecting to\n$url\n" ] ]
+sub exact {
+ my ($ctx, $found, $mid) = @_;
+ my $h = PublicInbox::Hval->new_msgid($mid);
+ my $href = $h->{href};
+ my $html = $h->as_html;
+ my $title = "<$html> found in ";
+ my $end = @$found == 1 ? 'another inbox' : 'other inboxes';
+ $ctx->{-title_html} = $title . $end;
+ $ctx->{-upfx} = '../';
+ my $ext_urls = ext_urls($ctx, $mid, $href, $html);
+ my $code = (@$found == 1 && $ext_urls eq '') ? 200 : 300;
+ $ctx->{-html_tip} = join('',
+ "<pre>Message-ID: <$html>\nfound in $end:\n\n",
+ (map {
+ my $u = $_->base_url;
+ qq(<a\nhref="$u$href/">$u$html/</a>\n)
+ } @$found),
+ $ext_urls, '</pre>');
+ PublicInbox::WwwStream->response($ctx, $code);