# HG changeset patch # User Emmanuel Gil Peyrot # Date 1527870833 -7200 # Node ID b003d72d9ce61fe82d5fb9b44dd4c1df761508e4 # Parent 2a918a8c47dbbf83e40492d70bcd0d4609d686ea mod_cache_c2s_caps: Switch to origin.log to provide better debug to admins. diff -r 2a918a8c47db -r b003d72d9ce6 mod_cache_c2s_caps/mod_cache_c2s_caps.lua --- a/mod_cache_c2s_caps/mod_cache_c2s_caps.lua Fri Jun 01 18:24:34 2018 +0200 +++ b/mod_cache_c2s_caps/mod_cache_c2s_caps.lua Fri Jun 01 18:33:53 2018 +0200 @@ -25,18 +25,18 @@ in_flight_iqs[from..node_string] = nil; if node_string ~= node_query then - module:log("debug", "Wrong node for our disco#info query, expected %s, received %s", node_string, node_query); + origin.log("debug", "Wrong node for our disco#info query, expected %s, received %s", node_string, node_query); return; end local node, ver = node_query:match("([^#]+)#([^#]+)"); local hash = calculate_hash(query) if ver ~= hash then - module:log("debug", "Wrong hash for disco#info: %s ~= %s", ver, hash); + origin.log("debug", "Wrong hash for disco#info: %s ~= %s", ver, hash); end origin.caps_cache = query; - module:log("info", "Stored caps %s", ver); + origin.log("info", "Stored caps %s", ver); module:fire_event("c2s-capabilities-changed", { origin = origin }); return true; end @@ -57,7 +57,7 @@ local caps = stanza:get_child("c", "http://jabber.org/protocol/caps"); if caps == nil then - module:log("debug", "Presence without caps received, skipping"); + origin.log("debug", "Presence without caps received, skipping"); return; end @@ -68,17 +68,17 @@ return; end if hash ~= "sha-1" then - module:log("warn", "Non-SHA-1 caps received: %s", hash); + origin.log("warn", "Non-SHA-1 caps received: %s", hash); return; end local node_query = node.."#"..ver; if (origin.caps_cache and origin.caps_cache.attr.node == node_query) or in_flight_iqs[from..node_query] ~= nil then - module:log("debug", "Already requested these caps, skipping"); + origin.log("debug", "Already requested these caps, skipping"); return; end - module:log("debug", "Received presence with SHA-1 caps %s, querying disco#info", node_query); + origin.log("debug", "Received presence with SHA-1 caps %s, querying disco#info", node_query); local id = uuid_gen(); iq_node_map[from..id] = node_query