]> Sergey Matveev's repositories - public-inbox.git/commitdiff
feed: fix address when multiple addresses exist
authorEric Wong <e@80x24.org>
Mon, 21 Apr 2014 19:29:32 +0000 (19:29 +0000)
committerEric Wong <e@80x24.org>
Mon, 21 Apr 2014 19:29:32 +0000 (19:29 +0000)
This needs to be cleaned up

lib/PublicInbox/Feed.pm

index 8cc8b728887446aff0cb622352563ef1eb66ad7a..3fc3775ba454fad5019f6416f1dbd66aae3769c1 100644 (file)
@@ -32,7 +32,8 @@ sub generate {
 
        local $ENV{GIT_DIR} = $args->{git_dir};
        my $feed_opts = get_feedopts($args);
-
+       my $addr = $feed_opts->{address};
+       $addr = $addr->[0] if ref($addr);
        my $feed = XML::Atom::SimpleFeed->new(
                title => $feed_opts->{description} || "unnamed feed",
                link => $feed_opts->{url} || "http://example.com/",
@@ -41,7 +42,7 @@ sub generate {
                        href => $feed_opts->{atomurl} ||
                                "http://example.com/atom.xml",
                },
-               id => $feed_opts->{address} || 'public-inbox@example.com',
+               id => $addr || 'public-inbox@example.com',
                updated => POSIX::strftime(DATEFMT, gmtime),
        );