unofficial mirror of meta@public-inbox.org
 help / color / mirror / Atom feed
From: Eric Wong <e@80x24.org>
To: meta@public-inbox.org
Subject: [PATCH 2/6] lei_to_mail: get rid of empty _post_augment_maildir
Date: Fri, 19 Feb 2021 05:09:51 -0700	[thread overview]
Message-ID: <20210219120955.13891-3-e@80x24.org> (raw)
In-Reply-To: <20210219120955.13891-1-e@80x24.org>

We won't have _post_augment_imap when we add IMAP support,
either.

_pre_augment_imap will not exist, either, since opening an
IMAP(S) connection can be time consuming so we'll roll that
into imap_common_init.
---
 lib/PublicInbox/LeiToMail.pm | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/lib/PublicInbox/LeiToMail.pm b/lib/PublicInbox/LeiToMail.pm
index b90756ae..e89cca71 100644
--- a/lib/PublicInbox/LeiToMail.pm
+++ b/lib/PublicInbox/LeiToMail.pm
@@ -394,8 +394,6 @@ sub _do_augment_maildir {
 	}
 }
 
-sub _post_augment_maildir {} # noop
-
 sub _pre_augment_mbox {
 	my ($self, $lei) = @_;
 	my $dst = $lei->{ovv}->{dst};
@@ -441,8 +439,8 @@ sub _do_augment_mbox {
 sub pre_augment { # fast (1 disk seek), runs in same process as post_augment
 	my ($self, $lei) = @_;
 	# _pre_augment_maildir, _pre_augment_mbox
-	my $m = "_pre_augment_$self->{base_type}";
-	$self->$m($lei);
+	my $m = $self->can("_pre_augment_$self->{base_type}") or return;
+	$m->($self, $lei);
 }
 
 sub do_augment { # slow, runs in wq worker
@@ -455,9 +453,9 @@ sub do_augment { # slow, runs in wq worker
 # fast (spawn compressor or mkdir), runs in same process as pre_augment
 sub post_augment {
 	my ($self, $lei, @args) = @_;
-	# _post_augment_maildir, _post_augment_mbox
-	my $m = "_post_augment_$self->{base_type}";
-	$self->$m($lei, @args);
+	# _post_augment_mbox
+	my $m = $self->can("_post_augment_$self->{base_type}") or return;
+	$m->($self, $lei, @args);
 }
 
 sub ipc_atfork_child {

  parent reply	other threads:[~2021-02-19 12:09 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-19 12:09 [PATCH 0/6] lei: start working on IMAP writes Eric Wong
2021-02-19 12:09 ` [PATCH 1/6] t/lei-externals: favor "-o format:$PATHNAME" over "-f" Eric Wong
2021-02-19 12:09 ` Eric Wong [this message]
2021-02-19 12:09 ` [PATCH 3/6] tests: require Mail::IMAPClient for IMAP tests Eric Wong
2021-02-19 12:09 ` [PATCH 4/6] net_reader: handle single-message IMAP mailboxes Eric Wong
2021-02-19 12:09 ` [PATCH 5/6] net_writer: start implementing IMAP write support Eric Wong
2021-02-19 12:09 ` [PATCH 6/6] URIimap: overload "" to ->as_string Eric Wong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://public-inbox.org/README

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210219120955.13891-3-e@80x24.org \
    --to=e@80x24.org \
    --cc=meta@public-inbox.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).