diff options
author | Eric Wong <e@80x24.org> | 2021-05-23 21:36:50 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2021-05-24 22:31:36 +0000 |
commit | a9bfba8eb31dbb4cdb8306496a911a84f8ac6e04 (patch) | |
tree | c897e38b6de8c5e2673401bc66a2bd8088b895fe /lib/PublicInbox/LeiInspect.pm | |
parent | 2d4ac1c886908bb1d79592913a2a2037a1a024e7 (diff) | |
download | public-inbox-a9bfba8eb31dbb4cdb8306496a911a84f8ac6e04.tar.gz |
lei inspect: use LeiMailSync->match_imap_url
Move match_imap_url into LeiMailSync so it can be used in more places, such as "lei inspect". Upcoming commands such as "lei forget-mail-sync" and {add,forget,pause,resume}-watch will also support relaxed IMAP matching rules since there's no reasonable way to expect users use ";UIDVALIDITY=" on the command-line.
Diffstat (limited to 'lib/PublicInbox/LeiInspect.pm')
-rw-r--r-- | lib/PublicInbox/LeiInspect.pm | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/lib/PublicInbox/LeiInspect.pm b/lib/PublicInbox/LeiInspect.pm index f79ebc9a..7fd33289 100644 --- a/lib/PublicInbox/LeiInspect.pm +++ b/lib/PublicInbox/LeiInspect.pm @@ -31,18 +31,7 @@ sub inspect_sync_folder ($$) { my $lms = $lse->lms or return $ent; my @folders; if ($folder =~ m!\Aimaps?://!i) { - require PublicInbox::URIimap; - my $uri = PublicInbox::URIimap->new($folder)->canonical; - if (defined($uri->uidvalidity)) { - $folders[0] = $$uri; - } else { - my @maybe = $lms->folders($$uri); - @folders = grep { - my $u = PublicInbox::URIimap->new($_); - $uri->uidvalidity($u->uidvalidity); - $$uri eq $$u; - } @maybe; - } + @folders = map { $_->as_string } $lms->match_imap_url($folder); } elsif ($folder =~ m!\A(maildir|mh):(.+)!i) { my $type = lc $1; $folders[0] = "$type:".$lei->abs_path($2); |