about summary refs log tree commit homepage
path: root/lib/PublicInbox/NetReader.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2021-09-03 08:54:27 +0000
committerEric Wong <e@80x24.org>2021-09-03 08:57:36 +0000
commit42420897bd81bf5664d5a93c5069dda4cb0459f1 (patch)
treeee1146f0d7e4d8b530989ff2d0f871355b7508b2 /lib/PublicInbox/NetReader.pm
parenta3ad598c92039fae4a78354be9c33fff5328d7db (diff)
downloadpublic-inbox-42420897bd81bf5664d5a93c5069dda4cb0459f1.tar.gz
xt/net_writer-imap.t was completely broken in recent months and
I completely forgot this test.  net->add_url still only accepts
bare scalars (and not scalar refs), so we must set that up
properly.  Furthermore, our changes to do FLAGS-only
synchronization in lei of old messages was causing us to not
handle FLAGS properly for the test.
Diffstat (limited to 'lib/PublicInbox/NetReader.pm')
-rw-r--r--lib/PublicInbox/NetReader.pm5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/PublicInbox/NetReader.pm b/lib/PublicInbox/NetReader.pm
index 23445e7a..c050c60f 100644
--- a/lib/PublicInbox/NetReader.pm
+++ b/lib/PublicInbox/NetReader.pm
@@ -493,6 +493,9 @@ sub perm_fl_ok ($) {
         undef;
 }
 
+# may be overridden in NetWriter or Watch
+sub folder_select { $_[0]->{each_old} ? 'select' : 'examine' }
+
 sub _imap_fetch_all ($$$) {
         my ($self, $mic, $orig_uri) = @_;
         my $sec = uri_section($orig_uri);
@@ -501,7 +504,7 @@ sub _imap_fetch_all ($$$) {
 
         # we need to check for mailbox writability to see if we care about
         # FLAGS from already-imported messages.
-        my $cmd = $self->{each_old} ? 'select' : 'examine';
+        my $cmd = $self->folder_select;
         $mic->$cmd($mbx) or return "E: \U$cmd\E $mbx ($sec) failed: $!";
 
         my ($r_uidval, $r_uidnext, $perm_fl);