From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id AA52E1F9FC for ; Tue, 19 Oct 2021 09:33:46 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 02/11] lei up: prefix `remote' and `local' with `o_' Date: Tue, 19 Oct 2021 09:33:37 +0000 Message-Id: <20211019093346.30885-3-e@80x24.org> In-Reply-To: <20211019093346.30885-1-e@80x24.org> References: <20211019093346.30885-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: This will help distinguish between mail outputs and external public-inboxes. --- lib/PublicInbox/LeiUp.pm | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/lib/PublicInbox/LeiUp.pm b/lib/PublicInbox/LeiUp.pm index 396041771ff9..c35b2e42d49f 100644 --- a/lib/PublicInbox/LeiUp.pm +++ b/lib/PublicInbox/LeiUp.pm @@ -46,7 +46,7 @@ sub up1 ($$) { sub redispatch_all ($$) { my ($self, $lei) = @_; - my $upq = [ (@{$self->{local} // []}, @{$self->{remote} // []}) ]; + my $upq = [ (@{$self->{o_local} // []}, @{$self->{o_remote} // []}) ]; return up1($lei, $upq->[0]) if @$upq == 1; # just one, may start MUA # FIXME: this is also used per-query, see lei->_start_query @@ -81,12 +81,12 @@ sub lei_up { $lei->fail('--all and --mua= are incompatible'); @outs = PublicInbox::LeiSavedSearch::list($lei); if ($all eq 'local') { - $self->{local} = [ grep(!/$REMOTE_RE/, @outs) ]; + $self->{o_local} = [ grep(!/$REMOTE_RE/, @outs) ]; } elsif ($all eq 'remote') { - $self->{remote} = [ grep(/$REMOTE_RE/, @outs) ]; + $self->{o_remote} = [ grep(/$REMOTE_RE/, @outs) ]; } elsif ($all eq '') { - $self->{remote} = [ grep(/$REMOTE_RE/, @outs) ]; - $self->{local} = [ grep(!/$REMOTE_RE/, @outs) ]; + $self->{o_remote} = [ grep(/$REMOTE_RE/, @outs) ]; + $self->{o_local} = [ grep(!/$REMOTE_RE/, @outs) ]; } else { $lei->fail("only --all=$all not understood"); } @@ -94,16 +94,16 @@ sub lei_up { scalar(@outs) == 1 or die "BUG: lse set w/ >1 out[@outs]"; return up1($lei, $outs[0]); } else { - $self->{remote} = [ grep(/$REMOTE_RE/, @outs) ]; - $self->{local} = [ grep(!/$REMOTE_RE/, @outs) ]; + $self->{o_remote} = [ grep(/$REMOTE_RE/, @outs) ]; + $self->{o_local} = [ grep(!/$REMOTE_RE/, @outs) ]; } $lei->{lse} = $lei->_lei_store(1)->write_prepare($lei)->search; - ((@{$self->{local} // []} + @{$self->{remote} // []}) > 1 && + ((@{$self->{o_local} // []} + @{$self->{o_remote} // []}) > 1 && defined($opt->{mua})) and return $lei->fail(<{remote}) { # setup lei->{auth} - $self->prepare_inputs($lei, $self->{remote}) or return; + if ($self->{o_remote}) { # setup lei->{auth} + $self->prepare_inputs($lei, $self->{o_remote}) or return; } if ($lei->{auth}) { # start auth worker require PublicInbox::NetWriter;