Software /
code /
prosody
Changeset
4805:1aeece2cc814
mod_component: Components start out as component_unauthed until successful authentication (thanks xnyhps)
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Mon, 30 Apr 2012 01:02:39 +0100 |
parents | 4804:607414b26c8c |
children | 4806:27a99c289b90 |
files | plugins/mod_component.lua |
diffstat | 1 files changed, 2 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- 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]+$");