diff options
author | Matthew Wild <mwild1@gmail.com> | 2012-04-30 01:02:39 +0100 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2012-04-30 01:02:39 +0100 |
commit | 60c1421aa1de653586cb4effec5bf1e6c2b36b97 (patch) | |
tree | 3d9738221c31877c417aae97bfe5b134343b77b2 | |
parent | fc11973174f89bf02612e16b11f11dc7959828ad (diff) | |
download | prosody-60c1421aa1de653586cb4effec5bf1e6c2b36b97.tar.gz prosody-60c1421aa1de653586cb4effec5bf1e6c2b36b97.zip |
mod_component: Components start out as component_unauthed until successful authentication (thanks xnyhps)
-rw-r--r-- | plugins/mod_component.lua | 3 |
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]+$"); |