about summary refs log tree commit homepage
path: root/lib/PublicInbox/Feed.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2014-04-27 05:04:02 +0000
committerEric Wong <e@80x24.org>2014-04-27 05:59:24 +0000
commitf5a852a0fbaad70512abdbf4332dca343b85bc89 (patch)
treeb28d38a16cf2fe4643988bebc6f178bdf8648137 /lib/PublicInbox/Feed.pm
parent297b4cf31e6c46672f975eadb24b3617ded39a41 (diff)
downloadpublic-inbox-f5a852a0fbaad70512abdbf4332dca343b85bc89.tar.gz
Feed: <id> element must be a URI, oops :x
For each feed element, we'll just use the link since there's
currently no suitable URN.
Diffstat (limited to 'lib/PublicInbox/Feed.pm')
-rw-r--r--lib/PublicInbox/Feed.pm8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/PublicInbox/Feed.pm b/lib/PublicInbox/Feed.pm
index a8578e76..2dc3940f 100644
--- a/lib/PublicInbox/Feed.pm
+++ b/lib/PublicInbox/Feed.pm
@@ -36,7 +36,7 @@ sub generate {
                         href => $feed_opts->{atomurl} ||
                                 "http://example.com/atom.xml",
                 },
-                id => $addr || 'public-inbox@example.com',
+                id => 'mailto:' . ($addr || 'public-inbox@example.com'),
                 updated => POSIX::strftime(DATEFMT, gmtime),
         );
 
@@ -278,13 +278,17 @@ sub add_to_feed {
         my $date = $mime->header('Date');
         $date = PublicInbox::Hval->new_oneline($date);
         $date = feed_date($date->raw) or return 0;
+        $add =~ tr!/!!d;
+        my $h = '[a-f0-9]';
+        my (@uuid5) = ($add =~ m!\A($h{8})($h{4})($h{4})($h{4})($h{12})!o);
+
         $feed->add_entry(
                 author => { name => $name, email => $email },
                 title => $subject,
                 updated => $date,
                 content => { type => "html", content => $content },
                 link => $midurl . $href,
-                id => $add,
+                id => 'urn:uuid:' . join('-', @uuid5),
         );
         1;
 }