1 # Copyright (C) 2016 all contributors <meta@public-inbox.org>
2 # License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
4 # represents an NNTPD (currently a singleton),
5 # see script/public-inbox-nntpd for how it is used
6 package PublicInbox::NNTPD;
9 require PublicInbox::Config;
21 sub refresh_groups () {
23 my $pi_config = PublicInbox::Config->new;
26 $pi_config->each_inbox(sub {
28 my $ngname = $ng->{newsgroup} or return;
30 warn 'multiple newsgroups not supported: '.
31 join(', ', @$ngname). "\n";
32 } elsif ($ng->nntp_usable) {
33 # Only valid if msgmap and search works
34 $new->{$ngname} = $ng;
38 @list = sort { $a->{newsgroup} cmp $b->{newsgroup} } @list;
39 $self->{grouplist} = \@list;
40 # this will destroy old groups that got deleted
41 %{$self->{groups}} = %$new;