]> Sergey Matveev's repositories - public-inbox.git/commitdiff
wwwatomstream: use PublicInbox::Inbox->modified for feed_updated
authorEric Wong <e@yhbt.net>
Sun, 5 Jul 2020 23:27:34 +0000 (23:27 +0000)
committerEric Wong <e@yhbt.net>
Mon, 6 Jul 2020 20:01:15 +0000 (20:01 +0000)
stat(2) on the inboxdir is unlikely to be correct, now that
msgmap truncates its journal (rather than unlinking it).

lib/PublicInbox/WwwAtomStream.pm

index c494fa22679add475dd98f7d698ead5a8c98a30d..35b536c1cc9c2bff8e984906cf94db78296d4d6d 100644 (file)
@@ -93,8 +93,6 @@ sub atom_header {
                $self_url .= 'new.atom';
                $page_id = "mailto:$ibx->{-primary_address}";
        }
-       my $mtime = (stat($ibx->{inboxdir}))[9] || time;
-
        qq(<?xml version="1.0" encoding="us-ascii"?>\n) .
        qq(<feed\nxmlns="http://www.w3.org/2005/Atom"\n) .
        qq(xmlns:thr="http://purl.org/syndication/thread/1.0">) .
@@ -103,7 +101,7 @@ sub atom_header {
                qq(\nhref="$base_url"/>) .
        qq(<link\nrel="self"\nhref="$self_url"/>) .
        qq(<id>$page_id</id>) .
-       feed_updated($mtime);
+       feed_updated($ibx->modified);
 }
 
 # returns undef or string