Software /
code /
prosody
Comparison
plugins/mod_component.lua @ 6773:ef22c17cc24d
mod_component: Fire an event on successful component authentication (For Goffi)
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Mon, 10 Aug 2015 22:13:02 +0200 |
parent | 6380:4220ffb87b22 |
child | 6774:3965662ae091 |
child | 8233:4e7269c53659 |
comparison
equal
deleted
inserted
replaced
6743:adf2fdf1264a | 6773:ef22c17cc24d |
---|---|
83 session.on_destroy = on_destroy; | 83 session.on_destroy = on_destroy; |
84 session.component_validate_from = module:get_option_boolean("validate_from_addresses", true); | 84 session.component_validate_from = module:get_option_boolean("validate_from_addresses", true); |
85 session.type = "component"; | 85 session.type = "component"; |
86 module:log("info", "External component successfully authenticated"); | 86 module:log("info", "External component successfully authenticated"); |
87 session.send(st.stanza("handshake")); | 87 session.send(st.stanza("handshake")); |
88 module:fire_event("component-authenticated", { session = session }); | |
88 | 89 |
89 return true; | 90 return true; |
90 end | 91 end |
91 module:hook("stanza/jabber:component:accept:handshake", handle_component_auth, -1); | 92 module:hook("stanza/jabber:component:accept:handshake", handle_component_auth, -1); |
92 | 93 |