]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/LeiMailDiff.pm
imap+nntp: share COMPRESS implementation
[public-inbox.git] / lib / PublicInbox / LeiMailDiff.pm
index 4f3a4608d8e0beceafda3830b9fff41ffbae6b4d..2b4cfd9e102c9682b1093dc5ae9b25d2e1a9dfbb 100644 (file)
@@ -76,25 +76,19 @@ sub input_eml_cb { # used by PublicInbox::LeiInput::input_fh
 
 sub lei_mail_diff {
        my ($lei, @argv) = @_;
-       $lei->{opt}->{'in-format'} //= 'eml';
        my $self = bless {}, __PACKAGE__;
        $self->prepare_inputs($lei, \@argv) or return;
        my $isatty = -t $lei->{1};
        $lei->{opt}->{color} //= $isatty;
        $lei->start_pager if $isatty;
-       my $ops = {};
-       $lei->{auth}->op_merge($ops, $self, $lei) if $lei->{auth};
-       (my $op_c, $ops) = $lei->workers_start($self, 1, $ops);
-       $lei->{wq1} = $self;
        $lei->{-err_type} = 'non-fatal';
-       net_merge_all_done($self) unless $lei->{auth};
-       $lei->wait_wq_events($op_c, $ops);
+       $lei->wq1_start($self);
 }
 
 no warnings 'once';
 *net_merge_all_done = \&PublicInbox::LeiInput::input_only_net_merge_all_done;
 
-package PublicInbox::ContentDigestDbg;
+package PublicInbox::ContentDigestDbg; # cf. PublicInbox::ContentDigest
 use strict;
 use v5.10.1;
 use Data::Dumper;
@@ -103,7 +97,7 @@ sub new { bless { dig => Digest::SHA->new(256), fh => $_[1] }, __PACKAGE__ }
 
 sub add {
        $_[0]->{dig}->add($_[1]);
-       print { $_[0]->{fh} } Dumper($_[1]) or die "print $!";
+       print { $_[0]->{fh} } Dumper([split(/^/sm, $_[1])]) or die "print $!";
 }
 
 sub hexdigest { $_[0]->{dig}->hexdigest; }