mod_smacks: Remove references to connection on hibernation
Still having the connection on the session may cause unintentional
behavior, such as the session being treated as if connected, even tho
the connection has been closed.
--- a/plugins/mod_smacks.lua Sat Dec 18 12:50:09 2021 +0100
+++ b/plugins/mod_smacks.lua Sat Dec 18 12:50:53 2021 +0100
@@ -440,7 +440,10 @@
sessionmanager.destroy_session(session, "Hibernating too long");
end);
if session.conn then
- session.conn:close();
+ local conn = session.conn;
+ c2s_sessions[conn] = nil;
+ session.conn = nil;
+ conn:close();
end
module:fire_event("smacks-hibernation-start", { origin = session; queue = session.outgoing_stanza_queue:table() });
return true; -- Postpone destruction for now