From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id D016E1FB0D for ; Fri, 27 Nov 2020 09:52:54 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 01/12] nntp: use Inbox->uidvalidity instead of ->mm->created_at Date: Fri, 27 Nov 2020 09:52:43 +0000 Message-Id: <20201127095254.21624-2-e@80x24.org> In-Reply-To: <20201127095254.21624-1-e@80x24.org> References: <20201127095254.21624-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: 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); }