Mercurial > prosody-modules
comparison mod_atom/mod_atom.lua @ 3273:78888f4ec7e3
mod_atom: Add node as portablecontacts preferredUsername
This shows up in Atom feeds generated by GNU Social
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Fri, 24 Aug 2018 22:59:24 +0200 |
| parents | 119e22ccd64a |
| children | 2acfb45fd9ec |
comparison
equal
deleted
inserted
replaced
| 3272:119e22ccd64a | 3273:78888f4ec7e3 |
|---|---|
| 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 :tag("author") | 24 :tag("author") |
| 25 :text_tag("name", user) | 25 :text_tag("name", user) |
| 26 :text_tag("preferredUsername", user, { xmlns = "http://portablecontacts.net/spec/1.0" }); | |
| 26 | 27 |
| 27 feed:reset(); | 28 feed:reset(); |
| 28 | 29 |
| 29 for i = #items, 1, -1 do | 30 for i = #items, 1, -1 do |
| 30 feed:add_direct_child(items[items[i]].tags[1]); | 31 feed:add_direct_child(items[items[i]].tags[1]); |
