about summary refs log tree commit homepage
path: root/lib/PublicInbox/NetReader.pm
diff options
context:
space:
mode:
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;