* [PATCH 4/9] lei_to_mail: cast to URIimap object early
2021-04-16 23:10 5% [PATCH 0/9] lei saved search usability improvements Eric Wong
@ 2021-04-16 23:10 7% ` Eric Wong
0 siblings, 0 replies; 2+ results
From: Eric Wong @ 2021-04-16 23:10 UTC (permalink / raw)
To: meta
NetReader->add_url supports URI-like objects, now. We'll be
relying on the canonicalization for LeiSavedSearch.
---
lib/PublicInbox/LeiToMail.pm | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/lib/PublicInbox/LeiToMail.pm b/lib/PublicInbox/LeiToMail.pm
index 4ebaf8f3..daa8084b 100644
--- a/lib/PublicInbox/LeiToMail.pm
+++ b/lib/PublicInbox/LeiToMail.pm
@@ -335,14 +335,16 @@ sub new {
$self->{base_type} = 'mbox';
} elsif ($fmt =~ /\Aimaps?\z/) { # TODO .onion support
require PublicInbox::NetWriter;
+ require PublicInbox::URIimap;
my $net = PublicInbox::NetWriter->new;
- $net->add_url($dst);
$net->{quiet} = $lei->{opt}->{quiet};
- my $err = $net->errors($dst);
+ my $uri = PublicInbox::URIimap->new($dst)->canonical;
+ $net->add_url($uri);
+ my $err = $net->errors;
return $lei->fail($err) if $err;
- require PublicInbox::URIimap; # TODO: URI cast early
- $self->{uri} = PublicInbox::URIimap->new($dst);
- $self->{uri}->mailbox or die "No mailbox: $dst";
+ $uri->mailbox or return $lei->fail("No mailbox: $dst");
+ $self->{uri} = $uri;
+ $dst = $lei->{ovv}->{dst} = $$uri; # canonicalized
$lei->{net} = $net;
$self->{base_type} = 'imap';
} else {
^ permalink raw reply related [relevance 7%]
* [PATCH 0/9] lei saved search usability improvements
@ 2021-04-16 23:10 5% Eric Wong
2021-04-16 23:10 7% ` [PATCH 4/9] lei_to_mail: cast to URIimap object early Eric Wong
0 siblings, 1 reply; 2+ results
From: Eric Wong @ 2021-04-16 23:10 UTC (permalink / raw)
To: meta
Found a few bugfixes along the way, but after thinking it over,
I think "lei up /path/to/maildir/or/mbox/or/IMAP-URI" makes the
most sense.
Eric Wong (9):
lei q: --save preserves relative time queries
lei: expose share_path as a method
lei: saved searches keyed only by path/URL and format
lei_to_mail: cast to URIimap object early
test_common: handle '-C' (chdir) spawn option properly
lei: fix rel2abs
lei up: support output destination as arg
lei q --save: avoid lei.q.format
lei q --save: clobber config file on repeats
lib/PublicInbox/Config.pm | 9 ++++
lib/PublicInbox/LEI.pm | 19 +++++----
lib/PublicInbox/LeiQuery.pm | 2 +-
lib/PublicInbox/LeiSavedSearch.pm | 71 ++++++++++++++++++++++++-------
lib/PublicInbox/LeiToMail.pm | 12 +++---
lib/PublicInbox/LeiUp.pm | 5 +--
lib/PublicInbox/Reply.pm | 10 +----
lib/PublicInbox/TestCommon.pm | 7 +++
t/lei-q-save.t | 36 ++++++++++++++--
9 files changed, 126 insertions(+), 45 deletions(-)
^ permalink raw reply [relevance 5%]
Results 1-2 of 2 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2021-04-16 23:10 5% [PATCH 0/9] lei saved search usability improvements Eric Wong
2021-04-16 23:10 7% ` [PATCH 4/9] lei_to_mail: cast to URIimap object early Eric Wong
Code repositories for project(s) associated with this public inbox
https://80x24.org/public-inbox.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).