changeset 3272:119e22ccd64a

mod_atom: Add some basic metadata to feed
author Kim Alvefur <zash@zash.se>
date Fri, 24 Aug 2018 22:58:48 +0200
parents 7504f765e767
children 78888f4ec7e3
files mod_atom/mod_atom.lua
diffstat 1 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mod_atom/mod_atom.lua	Fri Aug 24 21:36:58 2018 +0200
+++ b/mod_atom/mod_atom.lua	Fri Aug 24 22:58:48 2018 +0200
@@ -19,7 +19,13 @@
 			local ok, items = pubsub_service:get_items("urn:xmpp:microblog:0", actor);
 			if ok then
 				event.response.headers.content_type = "application/atom+xml";
-				local feed = st.stanza("feed", { xmlns = "http://www.w3.org/2005/Atom" });
+				local feed = st.stanza("feed", { xmlns = "http://www.w3.org/2005/Atom" })
+					:text_tag("generator", "Prosody", { uri = "xmpp:prosody.im", version = prosody.version })
+					:tag("author")
+						:text_tag("name", user)
+
+				feed:reset();
+
 				for i = #items, 1, -1 do
 					feed:add_direct_child(items[items[i]].tags[1]);
 				end