Software /
code /
prosody-modules
Diff
mod_muc_ban_ip/mod_muc_ban_ip.lua @ 3995:4c9805f29f2d
mod_muc_ban_ip: log fallback to module
author | Georg Lukas <georg@op-co.de> |
---|---|
date | Thu, 15 Aug 2019 09:26:02 +0200 |
parent | 3403:823027110e29 |
child | 4321:71498f484c22 |
line wrap: on
line diff
--- 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)