verse.component: Namespacing fixes

Tue, 09 Nov 2010 19:57:52 +0000

author
Matthew Wild <mwild1@gmail.com>
date
Tue, 09 Nov 2010 19:57:52 +0000
changeset 150
728cc7f2f0c2
parent 149
f5c524412939
child 151
75016d851648

verse.component: Namespacing fixes

component.lua file | annotate | diff | comparison | revisions
--- a/component.lua	Thu Oct 28 19:37:22 2010 +0100
+++ b/component.lua	Tue Nov 09 19:57:52 2010 +0000
@@ -18,7 +18,7 @@
 local stream_callbacks = {
 	stream_ns = xmlns_stream,
 	stream_tag = "stream",
-	 default_ns = "jabber:client" };
+	 default_ns = xmlns_component };
 	
 function stream_callbacks.streamopened(stream, attr)
 	stream.stream_id = attr.id;
@@ -35,8 +35,8 @@
 function stream_callbacks.handlestanza(stream, stanza)
 	if stanza.attr.xmlns == xmlns_stream then
 		return stream:event("stream-"..stanza.name, stanza);
-	elseif stanza.attr.xmlns then
-		return stream:event("stream/"..stanza.attr.xmlns, stanza);
+	elseif stanza.attr.xmlns or stanza.name == "handshake" then
+		return stream:event("stream/"..(stanza.attr.xmlns or xmlns_component), stanza);
 	end
 
 	return stream:event("stanza", stanza);

mercurial