diff options
author | Eric Wong <e@80x24.org> | 2016-07-09 08:01:17 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2016-07-09 08:01:17 +0000 |
commit | e634f3d6e168d157f205b938ab6a7c6c7564de07 (patch) | |
tree | d5063345b0dd36c24705e9fdc8f2d8f5955da307 | |
parent | 8c1a45d908f5476a1766c5c475439b15ec46df17 (diff) | |
download | public-inbox-e634f3d6e168d157f205b938ab6a7c6c7564de07.tar.gz |
This probably makes the most sense as it's structured like a changelog.
-rw-r--r-- | lib/PublicInbox/View.pm | 6 |
1 files changed, 4 insertions, 2 deletions
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} = '<pre>[No topics in range]</pre>'; 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 |