about summary refs log tree commit homepage
path: root/lib/PublicInbox
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2020-11-27 09:52:43 +0000
committerEric Wong <e@80x24.org>2020-11-28 04:53:11 +0000
commit98ff501233ee371c98519bf96394ef8085c3b076 (patch)
tree02a94c84950f5f85c5dfa4e1e02223495f1256a2 /lib/PublicInbox
parent95cb3e48fc5c4e847cdc111c2c8c9f0b70bdea56 (diff)
downloadpublic-inbox-98ff501233ee371c98519bf96394ef8085c3b076.tar.gz
nntp: use Inbox->uidvalidity instead of ->mm->created_at
This is memoized, and may allow us some future flexibility w.r.t
PublicInbox::Inbox-like objects.  While we're at it, use
defined-or ("//") in case somebody really set a public-inbox
creation time to the Unix epoch.
Diffstat (limited to 'lib/PublicInbox')
-rw-r--r--lib/PublicInbox/NNTP.pm4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/PublicInbox/NNTP.pm b/lib/PublicInbox/NNTP.pm
index 2f821fa6..2197d758 100644
--- a/lib/PublicInbox/NNTP.pm
+++ b/lib/PublicInbox/NNTP.pm
@@ -147,7 +147,7 @@ sub list_active_times ($;$) {
         wildmat2re($wildmat);
         foreach my $ng (@{$self->{nntpd}->{grouplist}}) {
                 $ng->{newsgroup} =~ $wildmat or next;
-                my $c = eval { $ng->mm->created_at } || time;
+                my $c = eval { $ng->uidvalidity } // time;
                 more($self, "$ng->{newsgroup} $c $ng->{-primary_address}");
         }
 }
@@ -255,7 +255,7 @@ sub cmd_newgroups ($$$;$$) {
         # TODO dists
         more($self, '231 list of new newsgroups follows');
         foreach my $ng (@{$self->{nntpd}->{grouplist}}) {
-                my $c = eval { $ng->mm->created_at } || 0;
+                my $c = eval { $ng->uidvalidity } // 0;
                 next unless $c > $ts;
                 group_line($self, $ng);
         }