diff options
author | Eric Wong <e@80x24.org> | 2014-04-12 09:59:41 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2014-04-14 08:21:35 +0000 |
commit | 0bce6aa8226a955208d45c418adf9e0ac5ee8aa5 (patch) | |
tree | aa4616b3f419e8da0879ba582cae4a9f18d84919 | |
parent | 6e517aa6dc310ec14c7f2e7cf5479d77f1be5069 (diff) | |
download | public-inbox-0bce6aa8226a955208d45c418adf9e0ac5ee8aa5.tar.gz |
This may be useful for generating List-Id headers and HTML pages.
-rw-r--r-- | lib/PublicInbox/Config.pm | 2 | ||||
-rw-r--r-- | t/config.t | 2 |
2 files changed, 4 insertions, 0 deletions
diff --git a/lib/PublicInbox/Config.pm b/lib/PublicInbox/Config.pm index c8f2a8d8..d71bc52e 100644 --- a/lib/PublicInbox/Config.pm +++ b/lib/PublicInbox/Config.pm @@ -64,6 +64,8 @@ sub lookup { my $listname = $pfx; $listname =~ s/\Apublicinbox\.//; $rv{listname} = $listname; + my $v = $rv{address}; + $rv{-primary_address} = ref($v) eq 'ARRAY' ? $v->[0] : $v; \%rv; } @@ -28,6 +28,7 @@ my $tmpdir = tempdir(CLEANUP => 1); is_deeply($cfg->lookup('bugs@public-inbox.org'), { 'mainrepo' => '/home/pi/bugs-main.git', 'address' => 'bugs@public-inbox.org', + -primary_address => 'bugs@public-inbox.org', 'description' => 'development discussion', 'listname' => 'bugs', }, "lookup matches expected output"); @@ -40,6 +41,7 @@ my $tmpdir = tempdir(CLEANUP => 1); 'address' => ['try@public-inbox.org', 'sandbox@public-inbox.org', 'test@public-inbox.org'], + -primary_address => 'try@public-inbox.org', 'mainrepo' => '/home/pi/test-main.git', 'description' => 'test/sandbox area, occasionally reset', 'listname' => 'test', |