- return [ $code, $h, [ "Redirecting to $url\n" ] ]
- }
- [ 404, [ 'Content-Type' => 'text/plain' ], [] ];
-}
-
-sub ng_mid_for {
- my ($ng, $info, $article) = @_;
- # may fail due to lack of Danga::Socket
- # for defer_weaken:
- require PublicInbox::NewsGroup;
- $ng = $info->{ng} ||=
- PublicInbox::NewsGroup->new($ng, $info->{git_dir}, '');
- $ng->mm->mid_for($article);
-}
-
-sub newsgroup_map {
- my ($self) = @_;
- my $rv;
- $rv = $self->{ng_map} and return $rv;
- my $pi_config = $self->{pi_config};
- my %ng_map;
- foreach my $k (keys %$pi_config) {
- $k =~ /\Apublicinbox\.([^\.]+)\.mainrepo\z/ or next;
- my $inbox = $1;
- my $git_dir = $pi_config->{"publicinbox.$inbox.mainrepo"};
- my $url = $pi_config->{"publicinbox.$inbox.url"};
- defined $url or next;
- my $ng = $pi_config->{"publicinbox.$inbox.newsgroup"};
- next if (!defined $ng) || ($ng eq ''); # disabled