]> Sergey Matveev's repositories - public-inbox.git/commitdiff
lei_to_mail: lazy-require LeiDedupe
authorEric Wong <e@80x24.org>
Thu, 31 Dec 2020 13:51:29 +0000 (13:51 +0000)
committerEric Wong <e@80x24.org>
Fri, 1 Jan 2021 05:00:39 +0000 (05:00 +0000)
LeiDedupe requires SQLite, so we may want to be able to test
writing mail without DBI or SQLite down the line.

lib/PublicInbox/LeiToMail.pm

index ead00d1a6d890be7720e61804d1495fd1c25dd0a..1c0f3108f632ec551bf5e3aad95802c961a92df4 100644 (file)
@@ -270,9 +270,11 @@ sub _mbox_write_cb ($$$$) {
 
 sub write_cb { # returns a callback for git_to_mail
        my ($cls, $dst, $lei) = @_;
+       require PublicInbox::LeiDedupe;
        if ($dst =~ s!\A(mbox(?:rd|cl|cl2|o))?:!!) {
                _mbox_write_cb($cls, $1, $dst, $lei);
        }
+       # TODO: Maildir, MH, IMAP, JMAP ...
 }
 
 1;