diff options
author | Eric Wong <e@80x24.org> | 2017-01-07 01:44:49 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2017-01-07 01:45:44 +0000 |
commit | b6de8d4f10aaca3f02707be45b4cd2dc04f48a1f (patch) | |
tree | c0a466c61dcf657bcc038caf949a3f3711e5dcc7 | |
parent | 37415497e02c3cacdd70060acddc2604342b66e5 (diff) | |
download | public-inbox-b6de8d4f10aaca3f02707be45b4cd2dc04f48a1f.tar.gz |
This allows certain inboxes to override the global nntpserver (perhaps under a different domain).
-rw-r--r-- | lib/PublicInbox/Config.pm | 2 | ||||
-rw-r--r-- | t/config.t | 6 |
2 files changed, 7 insertions, 1 deletions
diff --git a/lib/PublicInbox/Config.pm b/lib/PublicInbox/Config.pm index 55019e9f..28b5bdb5 100644 --- a/lib/PublicInbox/Config.pm +++ b/lib/PublicInbox/Config.pm @@ -136,7 +136,7 @@ sub _fill { foreach my $k (qw(mainrepo address filter url newsgroup infourl watch watchheader httpbackendmax - feedmax)) { + feedmax nntpserver)) { my $v = $self->{"$pfx.$k"}; $rv->{$k} = $v if defined $v; } @@ -78,6 +78,12 @@ my $tmpdir = tempdir('pi-config-XXXXXX', TMPDIR => 1, CLEANUP => 1); my $cfg = PublicInbox::Config->new(\%tmp); my $ibx = $cfg->lookup_name('test'); is($ibx->{nntpserver}, 'news.example.com', 'global NNTP server'); + + delete $h{'publicinbox.nntpserver'}; + $h{"$pfx.nntpserver"} = 'news.alt.example.com'; + $cfg = PublicInbox::Config->new(\%h); + $ibx = $cfg->lookup_name('test'); + is($ibx->{nntpserver}, 'news.alt.example.com','per-inbox NNTP server'); } done_testing(); |