Comparison

util/xmppstream.lua @ 4012:a4f8e226bc4a

util.xmppstream: Allow stream_ns = "" for parsing streams with no xmlns
author Matthew Wild <mwild1@gmail.com>
date Tue, 21 Dec 2010 14:44:13 +0000
parent 3830:6e13a7a0b535
child 3987:8fbf57722368
child 4275:5305a665bdd4
comparison
equal deleted inserted replaced
3925:65c666d18096 4012:a4f8e226bc4a
43 local cb_streamclosed = stream_callbacks.streamclosed; 43 local cb_streamclosed = stream_callbacks.streamclosed;
44 local cb_error = stream_callbacks.error or function(session, e) error("XML stream error: "..tostring(e)); end; 44 local cb_error = stream_callbacks.error or function(session, e) error("XML stream error: "..tostring(e)); end;
45 local cb_handlestanza = stream_callbacks.handlestanza; 45 local cb_handlestanza = stream_callbacks.handlestanza;
46 46
47 local stream_ns = stream_callbacks.stream_ns or xmlns_streams; 47 local stream_ns = stream_callbacks.stream_ns or xmlns_streams;
48 local stream_tag = stream_ns..ns_separator..(stream_callbacks.stream_tag or "stream"); 48 local stream_tag = stream_callbacks.stream_tag or "stream";
49 if stream_ns ~= "" then
50 stream_tag = stream_ns..ns_separator..stream_tag;
51 end
49 local stream_error_tag = stream_ns..ns_separator..(stream_callbacks.error_tag or "error"); 52 local stream_error_tag = stream_ns..ns_separator..(stream_callbacks.error_tag or "error");
50 53
51 local stream_default_ns = stream_callbacks.default_ns; 54 local stream_default_ns = stream_callbacks.default_ns;
52 55
53 local chardata, stanza = {}; 56 local chardata, stanza = {};