From e634f3d6e168d157f205b938ab6a7c6c7564de07 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sat, 9 Jul 2016 08:01:17 +0000 Subject: view: show most recently updated topics, first 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(-) (limited to 'lib/PublicInbox/View.pm') diff --git a/lib/PublicInbox/View.pm b/lib/PublicInbox/View.pm index 5a312d84..3b041aab 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 -- cgit v1.2.3-24-ge0c7