mod_muc_ban_ip: log fallback to module
authorGeorg Lukas <georg@op-co.de>
Thu, 15 Aug 2019 09:26:02 +0200
changeset 3999 4c9805f29f2d
parent 3998 5a3dfb970888
child 4000 42682505e692
mod_muc_ban_ip: log fallback to module
mod_muc_ban_ip/mod_muc_ban_ip.lua
--- a/mod_muc_ban_ip/mod_muc_ban_ip.lua	Mon Apr 27 17:18:24 2020 +0200
+++ b/mod_muc_ban_ip/mod_muc_ban_ip.lua	Thu Aug 15 09:26:02 2019 +0200
@@ -47,13 +47,13 @@
 	local ip = origin.ip;
 	local to = jid_bare(stanza.attr.to);
 	if ip_bans[ip] and ip_bans[ip][to] then
-		origin.log("debug", "IP banned: %s is banned from %s", ip, to)
+		(origin.log or module._log)("debug", "IP banned: %s is banned from %s", ip, to)
 		origin.send(st.error_reply(stanza, "auth", "forbidden")
 			:tag("x", { xmlns = xmlns_muc_user })
 				:tag("status", { code = '301' }));
 		return true;
 	end
-	origin.log("debug", "IP not banned: %s from %s", ip, to)
+	(origin.log or module._log)("debug", "IP not banned: %s from %s", ip, to)
 end
 
 function module.add_host(module)