about summary refs log tree commit homepage
diff options
context:
space:
mode:
-rw-r--r--lib/PublicInbox/View.pm5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/PublicInbox/View.pm b/lib/PublicInbox/View.pm
index 07023e81..ccdcde2a 100644
--- a/lib/PublicInbox/View.pm
+++ b/lib/PublicInbox/View.pm
@@ -823,7 +823,10 @@ sub add_topic {
 
                 my $u = $x->header('X-PI-From');
                 my $ts = $x->header('X-PI-TS');
-                $state->{latest}->{$topic} = [ $mid, $u, $ts ];
+                my $exist = $state->{latest}->{$topic};
+                if (!$exist || $exist->[2] < $ts) {
+                        $state->{latest}->{$topic} = [ $mid, $u, $ts ];
+                }
         } else {
                 # ghost message, do not bump level
                 $child_adjust = 0;