Comparison

plugins/mod_smacks.lua @ 12075:9f4d88f54a54

mod_smacks: Avoid log noise when a non-smacks session is closed
author Kim Alvefur <zash@zash.se>
date Sun, 19 Dec 2021 14:59:27 +0100
parent 12074:b892f5489d79
child 12076:ad1fe36eaae7
comparison
equal deleted inserted replaced
12074:b892f5489d79 12075:9f4d88f54a54
198 return session; 198 return session;
199 end 199 end
200 200
201 module:hook("pre-session-close", function(event) 201 module:hook("pre-session-close", function(event)
202 local session = event.session; 202 local session = event.session;
203 if session.smacks == nil then return end
203 if session.resumption_token then 204 if session.resumption_token then
204 session.log("debug", "Revoking resumption token"); 205 session.log("debug", "Revoking resumption token");
205 session_registry[jid.join(session.username, session.host, session.resumption_token)] = nil; 206 session_registry[jid.join(session.username, session.host, session.resumption_token)] = nil;
206 old_session_registry:set(session.username, session.resumption_token, nil); 207 old_session_registry:set(session.username, session.resumption_token, nil);
207 session.resumption_token = nil; 208 session.resumption_token = nil;