]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/WwwAtomStream.pm
wwwatomstream: call gmtime with scalar
[public-inbox.git] / lib / PublicInbox / WwwAtomStream.pm
index 361e61f64e7f7be755e4d83895bbb8c19d3afb07..5d32294eec159f58cb9b2ff7153f512c5d0d3b63 100644 (file)
@@ -100,7 +100,11 @@ sub atom_header {
        } else {
                $title = title_tag($ibx->description);
                $self_url .= 'new.atom';
-               $page_id = "mailto:$ibx->{-primary_address}";
+               if (defined(my $addr = $ibx->{-primary_address})) {
+                       $page_id = "mailto:$addr";
+               } else {
+                       $page_id = to_uuid($self_url);
+               }
        }
        qq(<?xml version="1.0" encoding="us-ascii"?>\n) .
        qq(<feed\nxmlns="http://www.w3.org/2005/Atom"\n) .
@@ -157,7 +161,8 @@ sub feed_entry {
 }
 
 sub feed_updated {
-       '<updated>' . strftime('%Y-%m-%dT%H:%M:%SZ', gmtime(@_)) . '</updated>';
+       my ($t) = @_;
+       '<updated>' . strftime('%Y-%m-%dT%H:%M:%SZ', gmtime($t)) . '</updated>';
 }
 
 1;