From d6cc41b9ec7689bd58244744db820f9eb96989be Mon Sep 17 00:00:00 2001
From: Kim Alvefur <zash@zash.se>
Date: Wed, 15 Feb 2017 22:59:19 +0100
Subject: mod_saslauth: Cache logger in local for less typing

---
 plugins/mod_saslauth.lua | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

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();
-- 
cgit v1.2.3