mod_tls: Hook stream-features event using new events API.
authorWaqas Hussain <waqas20@gmail.com>
Thu, 11 Feb 2010 22:50:44 +0000 (03:50 +0500)
committerWaqas Hussain <waqas20@gmail.com>
Thu, 11 Feb 2010 22:50:44 +0000 (03:50 +0500)
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);