From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: 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.0 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 308861FF40; Sat, 9 Jul 2016 08:03:53 +0000 (UTC) Date: Sat, 9 Jul 2016 08:03:53 +0000 From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 2/1] view: show most recently updated topics, first Message-ID: <20160709080353.GA16248@dcvr.yhbt.net> References: <20160709075317.1803-1-e@80x24.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160709075317.1803-1-e@80x24.org> List-Id: This probably makes the most sense as it's structured like a changelog. --- lib/PublicInbox/View.pm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/PublicInbox/View.pm b/lib/PublicInbox/View.pm index 5a312d8..3b041aa 100644 --- a/lib/PublicInbox/View.pm +++ b/lib/PublicInbox/View.pm @@ -879,14 +879,16 @@ sub acc_topic { sub dump_topics { my ($ctx) = @_; - my $order = $ctx->{order}; # [ ts, subj1, subj2, subj3, ... ] + my $order = delete $ctx->{order}; # [ ts, subj1, subj2, subj3, ... ] if (!@$order) { $ctx->{-html_tip} = '
[No topics in range]
'; return 404; } my @out; - foreach my $topic (@$order) { + + # sort by recency, this allows new posts to "bump" old topics... + foreach my $topic (sort { $b->[0] <=> $a->[0] } @$order) { my ($ts, $n, $seen, $top, @ex) = @$topic; @$topic = (); next unless defined $top; # ghost topic -- EW