From 906393b801050e303d2ec2a660c85de4a5fa4740 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Wed, 1 Apr 2020 06:16:20 +0000 Subject: mid: add $MID_EXTRACT regexp for export This allows us to consistently enforce the same Message-ID extraction rules everywhere and makes it easier for us to make changes in the future. Update scripts/ssoma-replay, as well, but don't rely on PublicInbox::* modules in that since it's legacy and public-inbox was never a dependency of ssoma. --- lib/PublicInbox/View.pm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lib/PublicInbox/View.pm') diff --git a/lib/PublicInbox/View.pm b/lib/PublicInbox/View.pm index 5baaffaf..89174296 100644 --- a/lib/PublicInbox/View.pm +++ b/lib/PublicInbox/View.pm @@ -10,7 +10,8 @@ use bytes (); # only for bytes::length use PublicInbox::MsgTime qw(msg_datestamp); use PublicInbox::Hval qw(ascii_html obfuscate_addrs prurl mid_href); use PublicInbox::Linkify; -use PublicInbox::MID qw/id_compress mids mids_for_index references/; +use PublicInbox::MID qw(id_compress mids mids_for_index references + $MID_EXTRACT); use PublicInbox::MsgIter; use PublicInbox::Address; use PublicInbox::WwwStream; @@ -299,7 +300,7 @@ sub _th_index_lite { if (my $smsg = $node->{smsg}) { # delete saves about 200KB on a 1K message thread if (my $refs = delete $smsg->{references}) { - ($$irt) = ($refs =~ m/<([^>]+)>\z/); + ($$irt) = ($refs =~ m/$MID_EXTRACT\z/o); } } my $irt_map = $mapping->{$$irt} if defined $$irt; -- cgit v1.2.3-24-ge0c7