aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWaqas Hussain <waqas20@gmail.com>2010-02-12 04:22:01 +0500
committerWaqas Hussain <waqas20@gmail.com>2010-02-12 04:22:01 +0500
commitafea5e0f463ee036646e7aef9c217e7c271a4d40 (patch)
treec3d31b5d1a0ba2d1ffcff06d9dfcf6fe3cd2b116
parent2d89cb62a336f3ff58deede88781e4b7d14b298f (diff)
downloadprosody-afea5e0f463ee036646e7aef9c217e7c271a4d40.tar.gz
prosody-afea5e0f463ee036646e7aef9c217e7c271a4d40.zip
mod_legacyauth: Hook stream-features event using new events API.
-rw-r--r--plugins/mod_legacyauth.lua7
1 files changed, 4 insertions, 3 deletions
diff --git a/plugins/mod_legacyauth.lua b/plugins/mod_legacyauth.lua
index c678dce1..9837920b 100644
--- a/plugins/mod_legacyauth.lua
+++ b/plugins/mod_legacyauth.lua
@@ -19,11 +19,12 @@ local nodeprep = require "util.encodings".stringprep.nodeprep;
local resourceprep = require "util.encodings".stringprep.resourceprep;
module:add_feature("jabber:iq:auth");
-module:add_event_hook("stream-features", function (session, features)
- if secure_auth_only and not session.secure then
+module:hook("stream-features", function(event)
+ local origin, features = event.origin, event.features;
+ if secure_auth_only and not origin.secure then
-- Sorry, not offering to insecure streams!
return;
- elseif not session.username then
+ elseif not origin.username then
features:tag("auth", {xmlns='http://jabber.org/features/iq-auth'}):up();
end
end);