mod_component: Rewrite jabber:client stanzas to jabber:component:accept, thanks JaredH!

Thu, 25 Jun 2009 01:38:53 +0100

author
Matthew Wild <mwild1@gmail.com>
date
Thu, 25 Jun 2009 01:38:53 +0100
changeset 1405
19269d278c38
parent 1404
12abd2da8885
child 1406
83c6fb3d9e73

mod_component: Rewrite jabber:client stanzas to jabber:component:accept, thanks JaredH!

plugins/mod_component.lua file | annotate | diff | comparison | revisions
--- a/plugins/mod_component.lua	Wed Jun 24 20:09:44 2009 +0500
+++ b/plugins/mod_component.lua	Thu Jun 25 01:38:53 2009 +0100
@@ -64,7 +64,12 @@
 	-- If component not already created for this host, create one now
 	if not hosts[session.host].connected then
 		local send = session.send;
-		session.component_session = cm_register_component(session.host, function (_, data) return send(data); end);
+		session.component_session = cm_register_component(session.host, function (_, data) 
+				if data.attr and data.attr.xmlns == "jabber:client" then
+					data.attr.xmlns = nil;
+				end
+				return send(data);
+			end);
 		hosts[session.host].connected = true;
 		log("info", "Component successfully registered");
 	else

mercurial