+ if ($name ne ($self->{servername} // '')) {
+ $self->{servername} = $name;
+ $self->{greet} = \"201 $name ready - post via email\r\n";
+ }
+ my $groups = $pi_cfg->{-by_newsgroup}; # filled during each_inbox
+ my $cache = eval { $pi_cfg->ALL->misc->nntpd_cache_load } // {};
+ $pi_cfg->each_inbox(sub {
+ my ($ibx) = @_;
+ my $ngname = $ibx->{newsgroup} // return;
+ my $ce = $cache->{$ngname};
+ if (($ce and (%$ibx = (%$ibx, %$ce))) || $ibx->nntp_usable) {
+ # only valid if msgmap and over works
+ # preload to avoid fragmentation:
+ $ibx->description;
+ } else {
+ delete $groups->{$ngname};
+ # Note: don't be tempted to delete more for memory
+ # savings just yet: NNTP, IMAP, and WWW may all
+ # run in the same process someday.
+ }
+ });
+ @{$self->{groupnames}} = sort(keys %$groups);