-sub do_p2q { # via wq_do
- my ($self) = @_;
- my $lei = $self->{lei};
- my $want = $lei->{opt}->{want} // [ qw(dfpost7) ];
- my @want = split(/[, ]+/, "@$want");
- for (@want) {
- /\A(?:(d|dt|rt):)?([0-9]+)(\.(?:day|weeks)s?)?\z/ or next;
- my ($pfx, $n, $unit) = ($1, $2, $3);
- $n *= 86400 * ($unit =~ /week/i ? 7 : 1);
- $_ = [ $pfx, $n ];
- }
- my $smsg = bless {}, 'PublicInbox::Smsg';
- my $in = $self->{0};
- unless ($in) {
- my $input = $self->{input};
- if (-e $input) {
- $in = $lei->fopen('<', $input) or
- return $lei->fail("open < $input: $!");
- } else {
- my @cmd = (qw(git format-patch --stdout -1), $input);
- $in = popen_rd(\@cmd, undef, { 2 => $lei->{2} });
+sub input_eml_cb { # used by PublicInbox::LeiInput::input_fh
+ my ($self, $eml) = @_;
+ my $diff_want = $self->{diff_want} // do {
+ my $want = $self->{lei}->{opt}->{want} // [ qw(dfpost7) ];
+ my @want = split(/[, ]+/, "@$want");
+ for (@want) {
+ /\A(?:(d|dt|rt):)?([0-9]+)(\.(?:day|weeks)s?)?\z/
+ or next;
+ my ($pfx, $n, $unit) = ($1, $2, $3);
+ $n *= 86400 * ($unit =~ /week/i ? 7 : 1);
+ $_ = [ $pfx, $n ];