aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_component.lua
diff options
context:
space:
mode:
authorMarco Cirillo <maranda@lightwitch.org>2012-01-06 21:45:33 +0000
committerMarco Cirillo <maranda@lightwitch.org>2012-01-06 21:45:33 +0000
commit351b8347c855bf3bef851bf2aa28b4dc73f21743 (patch)
tree380bbb0e48b940c715b734400d6825c0a67db67e /plugins/mod_component.lua
parent876ae42f2a1613291a6ac9ccba8ab0ec5c145220 (diff)
downloadprosody-351b8347c855bf3bef851bf2aa28b4dc73f21743.tar.gz
prosody-351b8347c855bf3bef851bf2aa28b4dc73f21743.zip
mod_component: removed unused variable reference, added "flagging" to assert if a component is connected or not.
Diffstat (limited to 'plugins/mod_component.lua')
-rw-r--r--plugins/mod_component.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/plugins/mod_component.lua b/plugins/mod_component.lua
index 97c46a8c..f7d09930 100644
--- a/plugins/mod_component.lua
+++ b/plugins/mod_component.lua
@@ -10,8 +10,6 @@ if module:get_host_type() ~= "component" then
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 main_session, send;
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 @@ function handle_component_auth(event)
-- 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;