diff options
author | Eric Wong <e@80x24.org> | 2021-03-21 15:50:46 +0600 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2021-03-21 10:35:11 +0000 |
commit | 26f6047fff20159085e28bd1e8a6e83a1e952fe0 (patch) | |
tree | 2f80f7218f27dbc5cf737e32f6de7a61d6d93e5b /lib/PublicInbox/LeiXSearch.pm | |
parent | 47d21e78be57a8f4615be5872e08ec4539423d1f (diff) | |
download | public-inbox-26f6047fff20159085e28bd1e8a6e83a1e952fe0.tar.gz |
This will let us tie keywords from remote externals to those which only exist in local externals.
Diffstat (limited to 'lib/PublicInbox/LeiXSearch.pm')
-rw-r--r-- | lib/PublicInbox/LeiXSearch.pm | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/PublicInbox/LeiXSearch.pm b/lib/PublicInbox/LeiXSearch.pm index 17171a7f..b6aaf3e1 100644 --- a/lib/PublicInbox/LeiXSearch.pm +++ b/lib/PublicInbox/LeiXSearch.pm @@ -18,6 +18,7 @@ use PublicInbox::MID qw(mids); use PublicInbox::Smsg; use PublicInbox::Eml; use Fcntl qw(SEEK_SET F_SETFL O_APPEND O_RDWR); +use PublicInbox::ContentHash qw(git_sha); sub new { my ($class) = @_; @@ -207,10 +208,13 @@ sub query_mset { # non-parallel for non-"--threads" users sub each_remote_eml { # callback for MboxReader->mboxrd my ($eml, $self, $lei, $each_smsg) = @_; - if ($self->{import_sto} && !$lei->{ale}->xoids_for($eml, 1)) { + my $xoids = $lei->{ale}->xoids_for($eml, 1); + if ($self->{import_sto} && !$xoids) { $self->{import_sto}->ipc_do('add_eml', $eml); } my $smsg = bless {}, 'PublicInbox::Smsg'; + $smsg->{blob} = $xoids ? (keys(%$xoids))[0] + : git_sha(1, $eml)->hexdigest; $smsg->populate($eml); $smsg->parse_references($eml, mids($eml)); $smsg->{$_} //= '' for qw(from to cc ds subject references mid); |