# HG changeset patch # User Marco Cirillo # Date 1325886333 0 # Node ID b0574fc78a0a315e23c24bda588b502923c28260 # Parent df2cbc52c83b7d6fca99de93673f349977829bb3 mod_component: removed unused variable reference, added "flagging" to assert if a component is connected or not. diff -r df2cbc52c83b -r b0574fc78a0a plugins/mod_component.lua --- 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;