diff options
author | Eric Wong (Contractor, The Linux Foundation) <e@80x24.org> | 2018-03-29 09:57:46 +0000 |
---|---|---|
committer | Eric Wong (Contractor, The Linux Foundation) <e@80x24.org> | 2018-03-29 09:59:57 +0000 |
commit | d8e714970bbdf130568e17c114e747b5c3464d19 (patch) | |
tree | 4729e58889ae083c96b7a684e3dd91da90274594 /lib/PublicInbox/Inbox.pm | |
parent | 9aaf9cf73f7b126ad3d2726adf7c764630626d67 (diff) | |
download | public-inbox-d8e714970bbdf130568e17c114e747b5c3464d19.tar.gz |
The Message-ID mapped to an NNTP article number is stronger, so we will favor that for attachment lookups.
Diffstat (limited to 'lib/PublicInbox/Inbox.pm')
-rw-r--r-- | lib/PublicInbox/Inbox.pm | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/PublicInbox/Inbox.pm b/lib/PublicInbox/Inbox.pm index 47b86309..4c7305f9 100644 --- a/lib/PublicInbox/Inbox.pm +++ b/lib/PublicInbox/Inbox.pm @@ -298,9 +298,15 @@ sub msg_by_mid ($$;$) { my $srch = search($self) or return msg_by_path($self, mid2path($mid), $ref); my $smsg; - $srch->retry_reopen(sub { - $smsg = $srch->lookup_skeleton($mid) and $smsg->load_expand; - }); + # favor the Message-ID we used for the NNTP article number: + if (my $mm = mm($self)) { + my $num = $mm->num_for($mid); + $smsg = $srch->lookup_article($num); + } else { + $smsg = $srch->retry_reopen(sub { + $srch->lookup_skeleton($mid) and $smsg->load_expand; + }); + } $smsg ? msg_by_smsg($self, $smsg, $ref) : undef; } |