mod_bosh: Add jabber:client namespace to stanzas with no namespace

Sun, 04 Jul 2010 19:38:33 +0100

author
Matthew Wild <mwild1@gmail.com>
date
Sun, 04 Jul 2010 19:38:33 +0100
changeset 3322
c4e107e7c883
parent 3321
dcdfc04f9e3a
child 3323
5228a395999b

mod_bosh: Add jabber:client namespace to stanzas with no namespace

plugins/mod_bosh.lua file | annotate | diff | comparison | revisions
--- a/plugins/mod_bosh.lua	Sun Jul 04 19:16:20 2010 +0100
+++ b/plugins/mod_bosh.lua	Sun Jul 04 19:38:33 2010 +0100
@@ -190,6 +190,11 @@
 		local r, send_buffer = session.requests, session.send_buffer;
 		local response = { headers = default_headers }
 		function session.send(s)
+			-- We need to ensure that outgoing stanzas have the jabber:client xmlns
+			if s.attr and not s.attr.xmlns then
+				s = st.clone(s);
+				s.attr.xmlns = "jabber:client";
+			end
 			--log("debug", "Sending BOSH data: %s", tostring(s));
 			local oldest_request = r[1];
 			if oldest_request then

mercurial