aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_saslauth.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2017-02-15 22:59:19 +0100
committerKim Alvefur <zash@zash.se>2017-02-15 22:59:19 +0100
commit39639a7c38e9c7fe02e4bbfb649f2664eda06dd9 (patch)
treeec089ede9e558db9ed284aa0728242ef90f4050b /plugins/mod_saslauth.lua
parentfc7dadb6a71c4294edfd8e0844f929f757927a5e (diff)
downloadprosody-39639a7c38e9c7fe02e4bbfb649f2664eda06dd9.tar.gz
prosody-39639a7c38e9c7fe02e4bbfb649f2664eda06dd9.zip
mod_saslauth: Cache logger in local for less typing
Diffstat (limited to 'plugins/mod_saslauth.lua')
-rw-r--r--plugins/mod_saslauth.lua3
1 files changed, 2 insertions, 1 deletions
diff --git a/plugins/mod_saslauth.lua b/plugins/mod_saslauth.lua
index 9917c303..f7803bc9 100644
--- a/plugins/mod_saslauth.lua
+++ b/plugins/mod_saslauth.lua
@@ -223,6 +223,7 @@ local bind_attr = { xmlns='urn:ietf:params:xml:ns:xmpp-bind' };
local xmpp_session_attr = { xmlns='urn:ietf:params:xml:ns:xmpp-session' };
module:hook("stream-features", function(event)
local origin, features = event.origin, event.features;
+ local log = origin.log or log;
if not origin.username then
if secure_auth_only and not origin.secure then
return;
@@ -251,7 +252,7 @@ module:hook("stream-features", function(event)
if mechanisms[1] then
features:add_child(mechanisms);
else
- (origin.log or log)("warn", "No SASL mechanisms to offer");
+ log("warn", "No SASL mechanisms to offer");
end
else
features:tag("bind", bind_attr):tag("required"):up():up();