# HG changeset patch # User Waqas Hussain # Date 1265928644 -18000 # Node ID 35a5d1c5ea28f23016d36c6c0711c76844a4e8b0 # Parent c3fe88d4b921b8c8b04189b6ed393e1906e0255f mod_tls: Hook stream-features event using new events API. diff -r c3fe88d4b921 -r 35a5d1c5ea28 plugins/mod_tls.lua --- a/plugins/mod_tls.lua Fri Feb 12 03:49:05 2010 +0500 +++ b/plugins/mod_tls.lua Fri Feb 12 03:50:44 2010 +0500 @@ -42,8 +42,9 @@ end); -- Advertize stream feature -module:add_event_hook("stream-features", function(session, features) - if not session.username and session.conn.starttls then +module:hook("stream-features", function(event) + local origin, features = event.origin, event.features; + if not origin.username and origin.conn.starttls then features:add_child(c2s_feature); end end);