about summary refs log tree commit homepage
path: root/lib/PublicInbox/LeiStore.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2023-06-15 08:46:37 +0000
committerEric Wong <e@80x24.org>2023-06-15 19:40:55 +0000
commitdd1c202fdec09f47dc2d17b715b2c5b78f506ac8 (patch)
tree1e6a92dcbb3ad6ed1adfa3ec306b727064fb6a07 /lib/PublicInbox/LeiStore.pm
parent5cc2ba790f52084ac98b367ad9182c55b68da131 (diff)
downloadpublic-inbox-dd1c202fdec09f47dc2d17b715b2c5b78f506ac8.tar.gz
When import hits blobs it's already seen, we'll add labels
regardless in order to match the behavior of other inexact
matches.  This is useful when importing exact copies of
messages which exist in multiple mailboxes.

I noticed this when I had a message imported from my normal IMAP
`INBOX', but also copied it to a different folder for future
reference.
Diffstat (limited to 'lib/PublicInbox/LeiStore.pm')
-rw-r--r--lib/PublicInbox/LeiStore.pm8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/PublicInbox/LeiStore.pm b/lib/PublicInbox/LeiStore.pm
index cf5a03a0..727de066 100644
--- a/lib/PublicInbox/LeiStore.pm
+++ b/lib/PublicInbox/LeiStore.pm
@@ -387,8 +387,14 @@ sub add_eml {
                 _lms_rw($self)->set_src($smsg->oidbin, @{$vmd->{sync_info}});
         }
         unless ($im_mark) { # duplicate blob returns undef
-                return unless wantarray;
+                return unless wantarray || $vmd;
                 my @docids = $oidx->blob_exists($smsg->{blob});
+                if ($vmd) {
+                        for my $docid (@docids) {
+                                my $idx = $eidx->idx_shard($docid);
+                                _add_vmd($self, $idx, $docid, $vmd);
+                        }
+                }
                 return _docids_and_maybe_kw $self, \@docids;
         }