about summary refs log tree commit homepage
path: root/lib/PublicInbox/NetReader.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2021-02-17 09:07:00 -0100
committerEric Wong <e@80x24.org>2021-02-18 03:57:17 -0400
commitf72a415fd2594b2975cea2275dd67904e1f65a0c (patch)
tree92697aafd0a070fbe5711cd213cbee092bae6bb2 /lib/PublicInbox/NetReader.pm
parentd05c52bbd84ec2df01801c62964e24f960c6cfdf (diff)
downloadpublic-inbox-f72a415fd2594b2975cea2275dd67904e1f65a0c.tar.gz
More to come in a later commit; some error handling and failure
modes will be trickier with IMAP due to authentication.
Diffstat (limited to 'lib/PublicInbox/NetReader.pm')
-rw-r--r--lib/PublicInbox/NetReader.pm19
1 files changed, 19 insertions, 0 deletions
diff --git a/lib/PublicInbox/NetReader.pm b/lib/PublicInbox/NetReader.pm
index fa337bcd..1d053425 100644
--- a/lib/PublicInbox/NetReader.pm
+++ b/lib/PublicInbox/NetReader.pm
@@ -280,4 +280,23 @@ sub imap_common_init ($) {
         $mics;
 }
 
+sub add_url {
+        my ($self, $arg) = @_;
+        if (my $url = imap_url($arg)) {
+                push @{$self->{imap_order}}, $url;
+        } else {
+                push @{$self->{unsupported_url}}, $arg;
+        }
+}
+
+sub errors {
+        my ($self) = @_;
+        if (my $u = $self->{unsupported_url}) {
+                return "Unsupported URL(s): @$u";
+        }
+        undef;
+}
+
+sub new { bless {}, shift };
+
 1;