# HG changeset patch # User Thilo Cestonaro # Date 1255721459 -7200 # Node ID ea756d96584f8c1fc04be817740f3766be77405f # Parent 3f5bbd7c90d491c23364acd9bb5fbf3d968002e5 mod_privacy: nicer debug logging ... diff -r 3f5bbd7c90d4 -r ea756d96584f mod_privacy/mod_privacy.lua --- a/mod_privacy/mod_privacy.lua Fri Oct 16 20:51:14 2009 +0200 +++ b/mod_privacy/mod_privacy.lua Fri Oct 16 21:30:59 2009 +0200 @@ -323,7 +323,7 @@ local privacy_lists = datamanager.load(session.username, session.host, "privacy") or {}; local bare_jid = session.username.."@"..session.host; - module:log("debug", "stanza: %s, to: %s, from: %s", stanza.name, stanza.attr.to or "nil", stanza.attr.from or "nil"); + module:log("debug", "stanza: %s, to: %s, from: %s", tostring(stanza.name), tostring(stanza.attr.to), tostring(stanza.attr.from)); if stanza.attr.to ~= nil and stanza.attr.from ~= nil then if privacy_lists.lists == nil or @@ -406,7 +406,7 @@ end if apply then if block then - module:log("info", "stanza blocked: %s, to: %s, from: %s", stanza.name, stanza.attr.to or "nil", stanza.attr.from or "nil"); + module:log("info", "stanza blocked: %s, to: %s, from: %s", tostring(stanza.name), tostring(stanza.attr.to), tostring(stanza.attr.from)); if stanza.name == "message" then origin.send(st.error_reply(stanza, "cancel", "service-unavailable")); elseif stanza.name == "iq" and (stanza.attr.type == "get" or stanza.attr.type == "set") then @@ -447,7 +447,7 @@ if session ~= nil then return checkIfNeedToBeBlocked(e, session); else - module:log("debug", "preCheckIncoming: Couldn't get session for jid: %s@%s/%s", node or "nil", host or "nil", resource or "nil") + module:log("debug", "preCheckIncoming: Couldn't get session for jid: %s@%s/%s", tostring(node), tostring(host), tostring(resource)) end end return;