aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_component.lua
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2012-04-30 01:02:39 +0100
committerMatthew Wild <mwild1@gmail.com>2012-04-30 01:02:39 +0100
commitb56a39255a125794b8249719b39e1d40ca0a6804 (patch)
tree3d9738221c31877c417aae97bfe5b134343b77b2 /plugins/mod_component.lua
parentdacec4fc979b08fc495b7bca5d55d2c38516d9a2 (diff)
downloadprosody-b56a39255a125794b8249719b39e1d40ca0a6804.tar.gz
prosody-b56a39255a125794b8249719b39e1d40ca0a6804.zip
mod_component: Components start out as component_unauthed until successful authentication (thanks xnyhps)
Diffstat (limited to 'plugins/mod_component.lua')
-rw-r--r--plugins/mod_component.lua3
1 files changed, 2 insertions, 1 deletions
diff --git a/plugins/mod_component.lua b/plugins/mod_component.lua
index c4237b45..09b0d2b3 100644
--- a/plugins/mod_component.lua
+++ b/plugins/mod_component.lua
@@ -76,6 +76,7 @@ function module.add_host(module)
send = session.send;
session.on_destroy = on_destroy;
session.component_validate_from = module:get_option_boolean("validate_from_addresses", true);
+ session.type = "component";
module:log("info", "External component successfully authenticated");
session.send(st.stanza("handshake"));
@@ -244,7 +245,7 @@ end
function listener.onconnect(conn)
local _send = conn.write;
- local session = { type = "component", conn = conn, send = function (data) return _send(conn, tostring(data)); end };
+ local session = { type = "component_unauthed", conn = conn, send = function (data) return _send(conn, tostring(data)); end };
-- Logging functions --
local conn_name = "jcp"..tostring(conn):match("[a-f0-9]+$");