From 26f6047fff20159085e28bd1e8a6e83a1e952fe0 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sun, 21 Mar 2021 15:50:46 +0600 Subject: lei q: fix warning on remote imports This will let us tie keywords from remote externals to those which only exist in local externals. --- lib/PublicInbox/LeiXSearch.pm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'lib/PublicInbox/LeiXSearch.pm') 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); -- cgit v1.2.3-24-ge0c7