# HG changeset patch # User Matthew Wild # Date 1335744159 -3600 # Node ID 1aeece2cc814f8cb946f885b4a78aa4bd23b3bb9 # Parent 607414b26c8ca9a16c5477bf8a3668678ddd9e69 mod_component: Components start out as component_unauthed until successful authentication (thanks xnyhps) diff -r 607414b26c8c -r 1aeece2cc814 plugins/mod_component.lua --- a/plugins/mod_component.lua Mon Apr 30 00:52:43 2012 +0100 +++ b/plugins/mod_component.lua Mon Apr 30 01:02:39 2012 +0100 @@ -76,6 +76,7 @@ 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 @@ 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]+$");