Changeset

2378:649f733aa3dc

mod_pubsub_feeds/feeds.lib: Fix converting RSS items to more than one Atom entry (thanks walduhu)
author Kim Alvefur <zash@zash.se>
date Sat, 19 Nov 2016 18:48:49 +0100
parents 2377:02532f28b207
children 2379:bc6e63ab2a7c
files mod_pubsub_feeds/feeds.lib.lua
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mod_pubsub_feeds/feeds.lib.lua	Sat Nov 19 17:43:26 2016 +0100
+++ b/mod_pubsub_feeds/feeds.lib.lua	Sat Nov 19 18:48:49 2016 +0100
@@ -64,16 +64,16 @@
 	local feed = st.stanza("feed", { xmlns = "http://www.w3.org/2005/Atom" });
 	local channel = rss_feed:get_child("channel");
 	-- TODO channel properties
-	feed:tag("entry");
 	for item in channel:childtags("item") do
+		feed:tag("entry");
 		for tag in item:childtags() do
 			local translator = rss2atom[tag.name];
 			if translator then
 				translator(feed, tag);
 			end
 		end
+		feed:reset();
 	end
-	feed:reset();
 	return feed;
 end