Diff

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
line wrap: on
line diff
--- a/util/xmppstream.lua	Tue Dec 21 01:47:49 2010 +0000
+++ b/util/xmppstream.lua	Tue Dec 21 14:44:13 2010 +0000
@@ -45,7 +45,10 @@
 	local cb_handlestanza = stream_callbacks.handlestanza;
 	
 	local stream_ns = stream_callbacks.stream_ns or xmlns_streams;
-	local stream_tag = stream_ns..ns_separator..(stream_callbacks.stream_tag or "stream");
+	local stream_tag = stream_callbacks.stream_tag or "stream";
+	if stream_ns ~= "" then
+		stream_tag = stream_ns..ns_separator..stream_tag;
+	end
 	local stream_error_tag = stream_ns..ns_separator..(stream_callbacks.error_tag or "error");
 	
 	local stream_default_ns = stream_callbacks.default_ns;