Comparison

plugins/mod_bosh.lua @ 3322:c4e107e7c883

mod_bosh: Add jabber:client namespace to stanzas with no namespace
author Matthew Wild <mwild1@gmail.com>
date Sun, 04 Jul 2010 19:38:33 +0100
parent 3071:39a870ae75d9
child 3439:3d1eacf45230
comparison
equal deleted inserted replaced
3321:dcdfc04f9e3a 3322:c4e107e7c883
188 188
189 log("info", "New BOSH session, assigned it sid '%s'", sid); 189 log("info", "New BOSH session, assigned it sid '%s'", sid);
190 local r, send_buffer = session.requests, session.send_buffer; 190 local r, send_buffer = session.requests, session.send_buffer;
191 local response = { headers = default_headers } 191 local response = { headers = default_headers }
192 function session.send(s) 192 function session.send(s)
193 -- We need to ensure that outgoing stanzas have the jabber:client xmlns
194 if s.attr and not s.attr.xmlns then
195 s = st.clone(s);
196 s.attr.xmlns = "jabber:client";
197 end
193 --log("debug", "Sending BOSH data: %s", tostring(s)); 198 --log("debug", "Sending BOSH data: %s", tostring(s));
194 local oldest_request = r[1]; 199 local oldest_request = r[1];
195 if oldest_request then 200 if oldest_request then
196 log("debug", "We have an open request, so sending on that"); 201 log("debug", "We have an open request, so sending on that");
197 response.body = t_concat{"<body xmlns='http://jabber.org/protocol/httpbind' sid='", sid, "' xmlns:stream = 'http://etherx.jabber.org/streams'>", tostring(s), "</body>" }; 202 response.body = t_concat{"<body xmlns='http://jabber.org/protocol/httpbind' sid='", sid, "' xmlns:stream = 'http://etherx.jabber.org/streams'>", tostring(s), "</body>" };