diff options
author | Eric Wong <e@80x24.org> | 2021-01-24 04:46:54 -0700 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2021-01-24 15:46:08 -0400 |
commit | 7355803ccf17bd609c9d667d3b9cadb2adfc31bd (patch) | |
tree | 543679a5e0b6d0e23b3322bb51af7dc53033ee5e /lib/PublicInbox/OverIdx.pm | |
parent | ac35655d75706ce297a71b6537334a2f690b6247 (diff) | |
download | public-inbox-7355803ccf17bd609c9d667d3b9cadb2adfc31bd.tar.gz |
Having parse_references in OverIdx was awkward and Smsg is a better place for it.
Diffstat (limited to 'lib/PublicInbox/OverIdx.pm')
-rw-r--r-- | lib/PublicInbox/OverIdx.pm | 22 |
1 files changed, 1 insertions, 21 deletions
diff --git a/lib/PublicInbox/OverIdx.pm b/lib/PublicInbox/OverIdx.pm index e606dcf5..985c5473 100644 --- a/lib/PublicInbox/OverIdx.pm +++ b/lib/PublicInbox/OverIdx.pm @@ -243,26 +243,6 @@ sub link_refs { $tid; } -sub parse_references ($$$) { - my ($smsg, $hdr, $mids) = @_; - my $refs = references($hdr); - push(@$refs, @$mids) if scalar(@$mids) > 1; - return $refs if scalar(@$refs) == 0; - - # prevent circular references here: - my %seen = ( $smsg->{mid} => 1 ); - my @keep; - foreach my $ref (@$refs) { - if (length($ref) > PublicInbox::MID::MAX_MID_SIZE) { - warn "References: <$ref> too long, ignoring\n"; - next; - } - push(@keep, $ref) unless $seen{$ref}++; - } - $smsg->{references} = '<'.join('> <', @keep).'>' if @keep; - \@keep; -} - # normalize subjects so they are suitable as pathnames for URLs # XXX: consider for removal sub subject_path ($) { @@ -283,7 +263,7 @@ sub add_overview { my ($self, $eml, $smsg) = @_; $smsg->{lines} = $eml->body_raw =~ tr!\n!\n!; my $mids = mids_for_index($eml); - my $refs = parse_references($smsg, $eml, $mids); + my $refs = $smsg->parse_references($eml, $mids); $mids->[0] //= $smsg->{mid} //= $eml->{-lei_fake_mid}; $smsg->{mid} //= ''; my $subj = $smsg->{subject}; |