Software /
code /
prosody
Comparison
plugins/mod_tls.lua @ 2607:35a5d1c5ea28
mod_tls: Hook stream-features event using new events API.
author | Waqas Hussain <waqas20@gmail.com> |
---|---|
date | Fri, 12 Feb 2010 03:50:44 +0500 |
parent | 2605:ade70495fe7f |
child | 2613:afa20941e098 |
comparison
equal
deleted
inserted
replaced
2606:c3fe88d4b921 | 2607:35a5d1c5ea28 |
---|---|
40 end | 40 end |
41 return true; | 41 return true; |
42 end); | 42 end); |
43 | 43 |
44 -- Advertize stream feature | 44 -- Advertize stream feature |
45 module:add_event_hook("stream-features", function(session, features) | 45 module:hook("stream-features", function(event) |
46 if not session.username and session.conn.starttls then | 46 local origin, features = event.origin, event.features; |
47 if not origin.username and origin.conn.starttls then | |
47 features:add_child(c2s_feature); | 48 features:add_child(c2s_feature); |
48 end | 49 end |
49 end); | 50 end); |
50 module:hook("s2s-stream-features", function(event) | 51 module:hook("s2s-stream-features", function(event) |
51 local session, features = event.session, event.features; | 52 local session, features = event.session, event.features; |