about summary refs log tree commit homepage
path: root/lib/PublicInbox/NNTP.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2015-09-20 09:34:52 +0000
committerEric Wong <e@80x24.org>2015-09-20 09:34:52 +0000
commitcb2d1876d776ae6b8ec1d172f1f64169fe1efd5c (patch)
treef42668ab116d78e74ba278c84de7cd278665aeb5 /lib/PublicInbox/NNTP.pm
parent2409d31225754eb27f2bea9cc4dc91d73f48fbc8 (diff)
downloadpublic-inbox-cb2d1876d776ae6b8ec1d172f1f64169fe1efd5c.tar.gz
Using non-hierarchical mailing list names for newsgroups
might confuse traditional newsreader software and perhaps
some humans.  Allow administrators to configure newsgroups
names and hierarchies to their liking.

Sorting the grouplist alphabetically should probably be
done anyways to improve usability for some clients which
won't sort themselves.
Diffstat (limited to 'lib/PublicInbox/NNTP.pm')
-rw-r--r--lib/PublicInbox/NNTP.pm12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/PublicInbox/NNTP.pm b/lib/PublicInbox/NNTP.pm
index 8f866859..79f2c2f8 100644
--- a/lib/PublicInbox/NNTP.pm
+++ b/lib/PublicInbox/NNTP.pm
@@ -93,7 +93,7 @@ sub list_overview_fmt ($$) {
 sub list_active ($;$) {
         my ($self, $wildmat) = @_;
         wildmat2re($wildmat);
-        foreach my $ng (values %{$self->{nntpd}->{groups}}) {
+        foreach my $ng (@{$self->{nntpd}->{grouplist}}) {
                 $ng->{name} =~ $wildmat or next;
                 group_line($self, $ng);
         }
@@ -102,7 +102,7 @@ sub list_active ($;$) {
 sub list_active_times ($;$) {
         my ($self, $wildmat) = @_;
         wildmat2re($wildmat);
-        foreach my $ng (values %{$self->{nntpd}->{groups}}) {
+        foreach my $ng (@{$self->{nntpd}->{grouplist}}) {
                 $ng->{name} =~ $wildmat or next;
                 my $c = eval { $ng->mm->created_at } || time;
                 more($self, "$ng->{name} $c $ng->{address}");
@@ -112,7 +112,7 @@ sub list_active_times ($;$) {
 sub list_newsgroups ($;$) {
         my ($self, $wildmat) = @_;
         wildmat2re($wildmat);
-        foreach my $ng (values %{$self->{nntpd}->{groups}}) {
+        foreach my $ng (@{$self->{nntpd}->{grouplist}}) {
                 $ng->{name} =~ $wildmat or next;
                 my $d = $ng->description;
                 more($self, "$ng->{name} $d");
@@ -137,7 +137,7 @@ sub cmd_list ($;$$) {
                 $arg->($self, @args);
         } else {
                 more($self, '215 list of newsgroups follows');
-                foreach my $ng (values %{$self->{nntpd}->{groups}}) {
+                foreach my $ng (@{$self->{nntpd}->{grouplist}}) {
                         group_line($self, $ng);
                 }
         }
@@ -200,7 +200,7 @@ sub cmd_newgroups ($$$;$$) {
 
         # TODO dists
         more($self, '231 list of new newsgroups follows');
-        foreach my $ng (values %{$self->{nntpd}->{groups}}) {
+        foreach my $ng (@{$self->{nntpd}->{grouplist}}) {
                 my $c = eval { $ng->mm->created_at } || 0;
                 next unless $c > $ts;
                 group_line($self, $ng);
@@ -249,7 +249,7 @@ sub cmd_newnews ($$$$;$$) {
         ngpat2re($keep);
         ngpat2re($skip);
         my @srch;
-        foreach my $ng (values %{$self->{nntpd}->{groups}}) {
+        foreach my $ng (@{$self->{nntpd}->{grouplist}}) {
                 $ng->{name} =~ $keep or next;
                 $ng->{name} =~ $skip and next;
                 my $srch = $ng->search or next;