diff options
author | Eric Wong <e@80x24.org> | 2017-06-22 21:04:53 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2017-06-22 21:04:53 +0000 |
commit | a141cefa8323bbdc2a5c83127cb9eec3f58dc005 (patch) | |
tree | 1079a918199c5fabff461b64d39a7c7f4c063c68 | |
parent | 1e57ecc0dcbc64a6829a93dc81cfb6ab6f0ce71b (diff) | |
download | public-inbox-a141cefa8323bbdc2a5c83127cb9eec3f58dc005.tar.gz |
This allows users to DRY up their config a bit and avoid specifying altid twice when reusing the NNTP-centric msgmap for [ruby-*:\d+] serial numbers. My current work-in-progress ~/.public-inbox/config entry for the ruby-core list is: ------8<------- [publicinbox "ruby-core"] address = ruby-core@ruby-lang.org url = //public-inbox.org/ruby-core mainrepo = /path/to/ruby-core.git newsgroup = inbox.comp.lang.ruby.core watchheader = List-Id:<ruby-core.ruby-lang.org> altid = serial:ruby-core:file=msgmap.sqlite3 watch = maildir:/path/to/Maildir/.INBOX.ruby filter = PublicInbox::Filter::RubyLang
-rw-r--r-- | lib/PublicInbox/Filter/RubyLang.pm | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/PublicInbox/Filter/RubyLang.pm b/lib/PublicInbox/Filter/RubyLang.pm index ec4bc320..5240e8df 100644 --- a/lib/PublicInbox/Filter/RubyLang.pm +++ b/lib/PublicInbox/Filter/RubyLang.pm @@ -15,10 +15,13 @@ sub new { my ($class, %opts) = @_; my $altid = delete $opts{-altid}; my $self = $class->SUPER::new(%opts); + my $ibx = $self->{-inbox}; # altid = serial:ruby-core:file=msgmap.sqlite3 + if (!$altid && $ibx && $ibx->{altid}) { + $altid ||= $ibx->{altid}->[0]; + } if ($altid) { require PublicInbox::MID; # mid_clean - my $ibx = $self->{-inbox}; require PublicInbox::AltId; $self->{-altid} = PublicInbox::AltId->new($ibx, $altid, 1); } |