X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=lib%2FPublicInbox%2FFilter%2FRubyLang.pm;h=a65a59716f9affa7b6befacf1eb04a5383ae5f01;hb=95bdac7f09c69036efed537a4d03d5bdd2ae4eb6;hp=cb69e38a68aa01891287edd8b53448e53cd36259;hpb=56489ee40e44255f2f9a00cd608bc366d2586306;p=public-inbox.git diff --git a/lib/PublicInbox/Filter/RubyLang.pm b/lib/PublicInbox/Filter/RubyLang.pm index cb69e38a..a65a5971 100644 --- a/lib/PublicInbox/Filter/RubyLang.pm +++ b/lib/PublicInbox/Filter/RubyLang.pm @@ -1,4 +1,4 @@ -# Copyright (C) 2017-2018 all contributors +# Copyright (C) 2017-2020 all contributors # License: AGPL-3.0+ # Filter for lists.ruby-lang.org trailers @@ -22,7 +22,6 @@ sub new { $altid ||= $ibx->{altid}->[0]; } if ($altid) { - require PublicInbox::MID; # mid_clean require PublicInbox::AltId; $self->{-altid} = PublicInbox::AltId->new($ibx, $altid, 1); } @@ -30,7 +29,7 @@ sub new { } sub scrub { - my ($self, $mime) = @_; + my ($self, $mime, $for_remove) = @_; # no msg_iter here, that is only for read-only access $mime->walk_parts(sub { my ($part) = $_[0]; @@ -43,14 +42,14 @@ sub scrub { } }); my $altid = $self->{-altid}; - if ($altid) { + if ($altid && !$for_remove) { my $hdr = $mime->header_obj; my $mids = mids($hdr); return $self->REJECT('Message-ID missing') unless (@$mids); my @v = $hdr->header_raw('X-Mail-Count'); my $n; foreach (@v) { - /\A\s*(\d+)\s*\z/ or next; + /\A\s*([0-9]+)\s*\z/ or next; $n = $1; last; }