diff options
author | Kim Alvefur <zash@zash.se> | 2022-05-21 13:11:25 +0200 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2022-05-21 13:11:25 +0200 |
commit | 1a87a2d40cf4812b57ea2db92ba4dd4364512e62 (patch) | |
tree | 2d6fd5d8861649ead53f5bd72e74b65210563da2 /plugins | |
parent | a350ea4f1ce48d4ba56f5c8f169906f12fac24db (diff) | |
download | prosody-1a87a2d40cf4812b57ea2db92ba4dd4364512e62.tar.gz prosody-1a87a2d40cf4812b57ea2db92ba4dd4364512e62.zip |
mod_smacks: Use session logging for remaining log messages
For consistency and easier correlation of session events.
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/mod_smacks.lua | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/plugins/mod_smacks.lua b/plugins/mod_smacks.lua index 06bfb53f..57d412ad 100644 --- a/plugins/mod_smacks.lua +++ b/plugins/mod_smacks.lua @@ -302,7 +302,7 @@ function handle_enable(session, stanza, xmlns_sm) if session.username then local old_sessions, err = all_old_sessions:get(session.username); - module:log("debug", "Old sessions: %q", old_sessions) + session.log("debug", "Old sessions: %q", old_sessions) if old_sessions then local keep, count = {}, 0; for token, info in it.sorted_pairs(old_sessions, function(a, b) @@ -314,11 +314,11 @@ function handle_enable(session, stanza, xmlns_sm) end all_old_sessions:set(session.username, keep); elseif err then - module:log("error", "Unable to retrieve old resumption counters: %s", err); + session.log("error", "Unable to retrieve old resumption counters: %s", err); end end - module:log("debug", "Enabling stream management"); + session.log("debug", "Enabling stream management"); session.smacks = xmlns_sm; wrap_session(session, false); @@ -353,7 +353,7 @@ module:hook("s2sout-established", function (event) end); function handle_enabled(session, stanza, xmlns_sm) -- luacheck: ignore 212/stanza - module:log("debug", "Enabling stream management"); + session.log("debug", "Enabling stream management"); session.smacks = xmlns_sm; wrap_session_in(session, false); @@ -367,10 +367,10 @@ module:hook_tag(xmlns_sm3, "enabled", function (session, stanza) return handle_e function handle_r(origin, stanza, xmlns_sm) -- luacheck: ignore 212/stanza if not origin.smacks then - module:log("debug", "Received ack request from non-smack-enabled session"); + origin.log("debug", "Received ack request from non-smack-enabled session"); return; end - module:log("debug", "Received ack request, acking for %d", origin.handled_stanza_count); + origin.log("debug", "Received ack request, acking for %d", origin.handled_stanza_count); -- Reply with <a> (origin.sends2s or origin.send)(st.stanza("a", { xmlns = xmlns_sm, h = format_h(origin.handled_stanza_count) })); -- piggyback our own ack request if needed (see request_ack_if_needed() for explanation of last_requested_h) |