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: |
* [RFC 7/7] view: show X-Alt-Message-ID in permalink view, too
  2019-10-24  0:12  6% [PATCH 0/7] redundant header madness Eric Wong
@ 2019-10-24  0:12  7% ` Eric Wong
  0 siblings, 0 replies; 2+ results
From: Eric Wong @ 2019-10-24  0:12 UTC (permalink / raw)
  To: meta

Since we index X-Alt-Message-ID (because we need to placate some
NNTP clients), we now display it as well, since that Message-ID
could be the X-Alt-Message-ID that the reader is actually
interested in.
---
 lib/PublicInbox/View.pm | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/lib/PublicInbox/View.pm b/lib/PublicInbox/View.pm
index 00bf38a9..39b04174 100644
--- a/lib/PublicInbox/View.pm
+++ b/lib/PublicInbox/View.pm
@@ -10,7 +10,7 @@ use bytes (); # only for bytes::length
 use PublicInbox::MsgTime qw(msg_datestamp);
 use PublicInbox::Hval qw/ascii_html obfuscate_addrs/;
 use PublicInbox::Linkify;
-use PublicInbox::MID qw/id_compress mid_escape mids references/;
+use PublicInbox::MID qw/id_compress mid_escape mids mids_for_index references/;
 use PublicInbox::MsgIter;
 use PublicInbox::Address;
 use PublicInbox::WwwStream;
@@ -629,7 +629,7 @@ sub _msg_html_prepare {
 	my $over = $ctx->{-inbox}->over;
 	my $obfs_ibx = $ctx->{-obfs_ibx};
 	my $rv = '';
-	my $mids = mids($hdr);
+	my $mids = mids_for_index($hdr);
 	if ($nr == 0) {
 		if ($more) {
 			$rv .=
@@ -691,9 +691,13 @@ sub _msg_html_prepare {
 		$rv .= "Message-ID: <$mhtml> ";
 		$rv .= "(<a\nhref=\"raw\">raw</a>)\n";
 	} else {
+		# X-Alt-Message-ID can happen if a message is injected from
+		# public-inbox-nntpd because of multiple Message-ID headers.
 		my $lnk = PublicInbox::Linkify->new;
 		my $s = '';
-		$s .= "Message-ID: $_\n" for ($hdr->header_raw('Message-ID'));
+		for my $h (qw(Message-ID X-Alt-Message-ID)) {
+			$s .= "$h: $_\n" for ($hdr->header_raw($h));
+		}
 		$lnk->linkify_mids('..', \$s, 1);
 		$rv .= $s;
 	}

^ permalink raw reply related	[relevance 7%]

* [PATCH 0/7] redundant header madness
@ 2019-10-24  0:12  6% Eric Wong
  2019-10-24  0:12  7% ` [RFC 7/7] view: show X-Alt-Message-ID in permalink view, too Eric Wong
  0 siblings, 1 reply; 2+ results
From: Eric Wong @ 2019-10-24  0:12 UTC (permalink / raw)
  To: meta

Garbage in, garbage out.  Since we try to never drop messages in
v2, we now better support horrible messages with redundant and
confusing headers in the HTML view and search indices.

I'm a little iffy on adding more support to X-Alt-Message-IDs
because it's a gross hack; but so was injecting new Message-IDs
to support different messages with different content.

And I very much want NNTP clients to be able to build partial
mirrors without relying on expensive git clones.  Those mirrors
should still be able to lookup messages by whatever Message-IDs
the message was known by.

Eric Wong (7):
  search: support multiple From/To/Cc/Subject headers
  view: display redundant headers in permalink
  view: move '<' and '>' outside <a>
  view: improve warning for multiple Message-IDs
  linkify: support adding "(raw)" link for Message-IDs

  # next two are RFCs but I'm leaning heavily on supporting them:
  index: allow search/lookups on X-Alt-Message-ID
  view: show X-Alt-Message-ID in permalink view, too

 lib/PublicInbox/Linkify.pm   |  31 ++++++++++
 lib/PublicInbox/MID.pm       |  27 +++++++--
 lib/PublicInbox/OverIdx.pm   |   4 +-
 lib/PublicInbox/SearchIdx.pm |   4 +-
 lib/PublicInbox/SearchMsg.pm |   4 +-
 lib/PublicInbox/View.pm      | 106 ++++++++++++++++++++---------------
 t/mid.t                      |   7 ++-
 t/psgi_v2.t                  |   2 +-
 t/v2reindex.t                |  16 ++++--
 t/v2writable.t               |  16 ++++++
 10 files changed, 153 insertions(+), 64 deletions(-)

^ permalink raw reply	[relevance 6%]

Results 1-2 of 2 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2019-10-24  0:12  6% [PATCH 0/7] redundant header madness Eric Wong
2019-10-24  0:12  7% ` [RFC 7/7] view: show X-Alt-Message-ID in permalink view, too 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).