From fbc11e24a72f41b0ed7ead30d199288a4d674be4 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Wed, 3 Mar 2021 13:48:57 +0000 Subject: lei q: import flags when clobbering/augmenting Maildirs This will eventually be supported for other mail stores, but Maildir is the easiest to test and support, here. This lets us avoid a situation where flag changes get lost between search results. --- lib/PublicInbox/LeiQuery.pm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'lib/PublicInbox/LeiQuery.pm') diff --git a/lib/PublicInbox/LeiQuery.pm b/lib/PublicInbox/LeiQuery.pm index b57d1cc5..c630d628 100644 --- a/lib/PublicInbox/LeiQuery.pm +++ b/lib/PublicInbox/LeiQuery.pm @@ -51,7 +51,10 @@ sub lei_q { # we'll allow "--only $LOCATION --local" my $sto = $self->_lei_store(1); my $lse = $sto->search; - $sto->write_prepare($self) if $opt->{'import-remote'} //= 1; + if (($opt->{'import-remote'} //= 1) | + ($opt->{'import-augment'} //= 1)) { + $sto->write_prepare($self); + } if ($opt->{'local'} //= scalar(@only) ? 0 : 1) { $lxs->prepare_external($lse); } -- cgit v1.2.3-24-ge0c7