diff mod_delegation/mod_delegation.lua @ 1777:c353acd1d366

Merge with Goffi
author Kim Alvefur <zash@zash.se>
date Mon, 10 Aug 2015 21:13:31 +0200
parents e7b5ab44339c
children d7c1daaf2dea
line wrap: on
line diff
--- a/mod_delegation/mod_delegation.lua	Sat Jul 18 23:11:59 2015 +0200
+++ b/mod_delegation/mod_delegation.lua	Mon Aug 10 21:13:31 2015 +0200
@@ -143,7 +143,9 @@
 	end
 end
 
-connected_cb:add(on_component_connected)
+if module:get_host_type() ~= "component" then
+    connected_cb:add(on_component_connected)
+end
 module:hook('component-authenticated', on_component_auth)
 module:hook('presence/initial', on_presence)
 
@@ -185,7 +187,7 @@
 	local iq = forwarded.tags[1]
 	if #forwarded ~= 1 or iq.name ~= "iq" or
         iq.attr.xmlns ~= 'jabber:client' or
-		(iq.attr.type =='result' and #iq ~= 1) or
+		(iq.attr.type =='result' and #iq > 1) or
 		(iq.attr.type == 'error' and #iq > 2) then
 		module:log("warn", "ignoring invalid iq result from managing entity %s", stanza.attr.from)
 		stanza_cache[stanza.attr.from][stanza.attr.id] = nil