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
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);
}