aboutsummaryrefslogtreecommitdiffstats
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
commitd6cc41b9ec7689bd58244744db820f9eb96989be (patch)
treeec089ede9e558db9ed284aa0728242ef90f4050b
parent49ae1e60fdc5f1a31b4c1ae5027a3fec76095a90 (diff)
downloadprosody-d6cc41b9ec7689bd58244744db820f9eb96989be.tar.gz
prosody-d6cc41b9ec7689bd58244744db820f9eb96989be.zip
mod_saslauth: Cache logger in local for less typing
-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();