Diff

plugins/mod_component.lua @ 4464:b0574fc78a0a

mod_component: removed unused variable reference, added "flagging" to assert if a component is connected or not.
author Marco Cirillo <maranda@lightwitch.org>
date Fri, 06 Jan 2012 21:45:33 +0000
parent 4323:53f3c3001499
child 4650:464ca74ddf6a
line wrap: on
line diff
--- a/plugins/mod_component.lua	Fri Jan 06 21:43:30 2012 +0000
+++ b/plugins/mod_component.lua	Fri Jan 06 21:45:33 2012 +0000
@@ -10,8 +10,6 @@
 	error("Don't load mod_component manually, it should be for a component, please see http://prosody.im/doc/components", 0);
 end
 
-local hosts = _G.hosts;
-
 local t_concat = table.concat;
 
 local sha1 = require "util.hashes".sha1;
@@ -23,6 +21,7 @@
 
 local function on_destroy(session, err)
 	if main_session == session then
+		connected = false;
 		main_session = nil;
 		send = nil;
 		session.on_destroy = nil;
@@ -83,6 +82,7 @@
 	
 	-- If component not already created for this host, create one now
 	if not main_session then
+		connected = true;
 		send = session.send;
 		main_session = session;
 		session.on_destroy = on_destroy;