# HG changeset patch # User Kim Alvefur # Date 1345217032 -7200 # Node ID 133ee88d19aec1f825bfbba639ab774dd8029cbd # Parent 966993356d2b9ba73a1ba15102d17af5bc64dacb mod_pubsub_hub: Add compat wrapping of Atom content for interop with PuSH diff -r 966993356d2b -r 133ee88d19ae mod_pubsub_hub/mod_pubsub_hub.lua --- a/mod_pubsub_hub/mod_pubsub_hub.lua Thu Aug 16 22:31:08 2012 +0200 +++ b/mod_pubsub_hub/mod_pubsub_hub.lua Fri Aug 17 17:23:52 2012 +0200 @@ -186,7 +186,14 @@ return m_max((now - next_check) - min_lease, min_lease); end +local xmlns_atom = "http://www.w3.org/2005/Atom"; +local st = require "util.stanza"; + local function on_notify(subscription, content) + if content.attr and content.attr.xmlns == xmlns_atom then + -- COMPAT This is required by the PubSubHubbub spec. + content = st.stanza("feed", {xmlns=xmlns_atom}):add_child(content); + end local body = tostring(content); local headers = { ["Content-Type"] = "application/xml",