about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2021-03-23 11:48:04 +0000
committerEric Wong <e@80x24.org>2021-03-24 01:33:26 +0000
commitd89c8c4486b2347eb6570fe1aeaf4c6efddca29f (patch)
tree8ed9ebe6ec22da911fae86af9223533074212608
parent1bc8c2c264b47079d424ac766095efee3bbc5da0 (diff)
downloadpublic-inbox-d89c8c4486b2347eb6570fe1aeaf4c6efddca29f.tar.gz
We'll use `undef' to denote keywords are unknown/unsupported,
instead of an empty arrayref.

This will let callers use the same callback and args for
imap_each.  Passing an empty arrayref to set_eml in LeiStore
causes keywords to be cleared completely, which is not desired
behavior when "lei import" is importing already-seen messages
from NNTP.
-rw-r--r--lib/PublicInbox/NetReader.pm5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/PublicInbox/NetReader.pm b/lib/PublicInbox/NetReader.pm
index bc211029..6a52b479 100644
--- a/lib/PublicInbox/NetReader.pm
+++ b/lib/PublicInbox/NetReader.pm
@@ -554,11 +554,10 @@ sub _nntp_fetch_all ($$$) {
                 return if $l_art >= $end; # nothing to do
                 $beg = $l_art + 1;
         }
-        my ($err, $art);
+        my ($err, $art, $last_art, $kw); # kw stays undef, no keywords in NNTP
         unless ($self->{quiet}) {
                 warn "# $uri fetching ARTICLE $beg..$end\n";
         }
-        my $last_art;
         my $n = $self->{max_batch};
         for ($beg..$end) {
                 last if $self->{quit};
@@ -582,7 +581,7 @@ sub _nntp_fetch_all ($$$) {
                 $raw = join('', @$raw);
                 $raw =~ s/\r\n/\n/sg;
                 my ($eml_cb, @args) = @{$self->{eml_each}};
-                $eml_cb->($uri, $art, [], PublicInbox::Eml->new(\$raw), @args);
+                $eml_cb->($uri, $art, $kw, PublicInbox::Eml->new(\$raw), @args);
                 $last_art = $art;
         }
         run_commit_cb($self);