From 60c1421aa1de653586cb4effec5bf1e6c2b36b97 Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Mon, 30 Apr 2012 01:02:39 +0100 Subject: mod_component: Components start out as component_unauthed until successful authentication (thanks xnyhps) --- plugins/mod_component.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'plugins') 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]+$"); -- cgit v1.2.3