my $name = $pfx;
$name =~ s/\Apublicinbox\.//;
$rv->{name} = $name;
- my $v = $rv->{address} ||= 'public-inbox@example.com';
- my $p = $rv->{-primary_address} = ref($v) eq 'ARRAY' ? $v->[0] : $v;
- $rv->{domain} = ($p =~ /\@(\S+)\z/) ? $1 : 'localhost';
$rv = PublicInbox::Inbox->new($rv);
+ my $v = $rv->{address};
if (ref($v) eq 'ARRAY') {
$self->{-by_addr}->{lc($_)} = $rv foreach @$v;
} else {
sub new {
my ($class, $opts) = @_;
+ my $v = $opts->{address} ||= 'public-inbox@example.com';
+ my $p = $opts->{-primary_address} = ref($v) eq 'ARRAY' ? $v->[0] : $v;
+ $opts->{domain} = ($p =~ /\@(\S+)\z/) ? $1 : 'localhost';
bless $opts, $class;
}
my $git_dir = "$tmpdir/gittest";
my $ibx = PublicInbox::Inbox->new({
address => 'test@example',
- -primary_address => 'test@example',
name => 'testbox',
mainrepo => $git_dir,
url => 'http://example.com/test',
my $git_dir = "$tmpdir/gittest";
my $ibx = PublicInbox::Inbox->new({
address => 'test@example',
- -primary_address => 'test@example',
name => 'tester',
mainrepo => $git_dir,
url => 'http://example.com/test',