diff mod_pubsub_feeds/feeds.lib.lua @ 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 85762420a2c0
children c402b273f2e3
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