X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=lib%2FPublicInbox%2FInbox.pm;h=95ffd039fdb7390b359c66bd30be6080d280e7cc;hb=0a3da12a2e68af1a979a42f4b429076b0979708d;hp=a5849a611165dc152a4946fb14e2a30dbe121bf5;hpb=fea03df0e2e95ad3ac44ac46d9c31da97fa2fde9;p=public-inbox.git diff --git a/lib/PublicInbox/Inbox.pm b/lib/PublicInbox/Inbox.pm index a5849a61..95ffd039 100644 --- a/lib/PublicInbox/Inbox.pm +++ b/lib/PublicInbox/Inbox.pm @@ -1,4 +1,4 @@ -# Copyright (C) 2016-2019 all contributors +# Copyright (C) 2016-2020 all contributors # License: AGPL-3.0+ # # Represents a public-inbox (which may have multiple mailing addresses) @@ -346,7 +346,7 @@ sub smsg_by_mid ($$) { # favor the Message-ID we used for the NNTP article number: defined(my $num = mid2num($self, $mid)) or return; my $smsg = $over->get_art($num) or return; - PublicInbox::SearchMsg::psgi_cull($smsg); + PublicInbox::Smsg::psgi_cull($smsg); } sub msg_by_mid ($$;$) { @@ -376,4 +376,19 @@ sub modified { git($self)->modified; # v1 } +# returns prefix => pathname mapping +# (pathname is NOT public, but prefix is used for Xapian queries) +sub altid_map ($) { + my ($self) = @_; + $self->{-altid_map} //= eval { + require PublicInbox::AltId; + my $altid = $self->{altid} or return {}; + my %h = map {; + my $x = PublicInbox::AltId->new($self, $_); + "$x->{prefix}" => $x->{filename} + } @$altid; + \%h; + } // {}; +} + 1;