comparison mod_atom/mod_atom.lua @ 3274:2acfb45fd9ec

mod_atom: Expose title and description from node metadata in feed
author Kim Alvefur <zash@zash.se>
date Fri, 24 Aug 2018 23:00:08 +0200
parents 78888f4ec7e3
children 25b4cad8fee4
comparison
equal deleted inserted replaced
3273:78888f4ec7e3 3274:2acfb45fd9ec
19 local ok, items = pubsub_service:get_items("urn:xmpp:microblog:0", actor); 19 local ok, items = pubsub_service:get_items("urn:xmpp:microblog:0", actor);
20 if ok then 20 if ok then
21 event.response.headers.content_type = "application/atom+xml"; 21 event.response.headers.content_type = "application/atom+xml";
22 local feed = st.stanza("feed", { xmlns = "http://www.w3.org/2005/Atom" }) 22 local feed = st.stanza("feed", { xmlns = "http://www.w3.org/2005/Atom" })
23 :text_tag("generator", "Prosody", { uri = "xmpp:prosody.im", version = prosody.version }) 23 :text_tag("generator", "Prosody", { uri = "xmpp:prosody.im", version = prosody.version })
24 :text_tag("title", pubsub_service.nodes["urn:xmpp:microblog:0"].config.title or "Microblog feed")
25 :text_tag("subtitle", pubsub_service.nodes["urn:xmpp:microblog:0"].config.description)
24 :tag("author") 26 :tag("author")
25 :text_tag("name", user) 27 :text_tag("name", user)
26 :text_tag("preferredUsername", user, { xmlns = "http://portablecontacts.net/spec/1.0" }); 28 :text_tag("preferredUsername", user, { xmlns = "http://portablecontacts.net/spec/1.0" });
27 29
28 feed:reset(); 30 feed:reset();