From b6829bbfd86f5d22a8ffb80fd7bfe59299fe6b55 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sat, 20 Mar 2021 19:04:04 +0900 Subject: lei q: support vmd for external-only messages "lei q" now preserves changes per-message keywords across invocations when it's --output (Maildir or mbox) is reused (with or without --augment). In the future, these changes will be monitored via inotify, EVFILT_VNODE or IMAP IDLE, too. Unfortunately, this currently prevents "lei import" from ever importing a message that's in an external. That will be fixed in a future change. --- lib/PublicInbox/LeiOverview.pm | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib/PublicInbox/LeiOverview.pm') diff --git a/lib/PublicInbox/LeiOverview.pm b/lib/PublicInbox/LeiOverview.pm index 1036f465..48237f8a 100644 --- a/lib/PublicInbox/LeiOverview.pm +++ b/lib/PublicInbox/LeiOverview.pm @@ -216,9 +216,11 @@ sub ovv_each_smsg_cb { # runs in wq worker usually } } elsif ($self->{fmt} =~ /\A(concat)?json\z/ && $lei->{opt}->{pretty}) { my $EOR = ($1//'') eq 'concat' ? "\n}" : "\n},"; + my $lse = $lei->{sto}->search; sub { # DIY prettiness :P my ($smsg, $mitem) = @_; return if $dedupe->is_smsg_dup($smsg); + $lse->xsmsg_vmd($smsg); $smsg = _unbless_smsg($smsg, $mitem); $buf .= "{\n"; $buf .= join(",\n", map { @@ -238,9 +240,11 @@ sub ovv_each_smsg_cb { # runs in wq worker usually } } elsif ($json) { my $ORS = $self->{fmt} eq 'json' ? ",\n" : "\n"; # JSONL + my $lse = $lei->{sto}->search; sub { my ($smsg, $mitem) = @_; return if $dedupe->is_smsg_dup($smsg); + $lse->xsmsg_vmd($smsg); $buf .= $json->encode(_unbless_smsg(@_)) . $ORS; return if length($buf) < 65536; my $lk = $self->lock_for_scope; -- cgit v1.2.3-24-ge0c7