From 98ff501233ee371c98519bf96394ef8085c3b076 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Fri, 27 Nov 2020 09:52:43 +0000 Subject: 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. --- lib/PublicInbox/NNTP.pm | 4 ++-- 1 file 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); } -- cgit v1.2.3-24-ge0c7