mod_tls: Hook stream-features event using new events API.
[prosody.git] / plugins / mod_tls.lua
index a17696c7bd5aa84dc64c29ba094a587a0c267f1a..dfc1e338c38269ec3f0ddb86850959e3b3302bb0 100644 (file)
@@ -42,8 +42,9 @@ module:hook("stanza/urn:ietf:params:xml:ns:xmpp-tls:starttls", function(event)
 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);