# HG changeset patch
# User Kim Alvefur <zash@zash.se>
# Date 1638410624 -3600
# Node ID c7c0c40487e25a6d4ee7997388eb7fa9e0ca136c
# Parent  5d8264f464a2b6ba6312e6f09f69c9ab2f0b24a4
mod_smacks: Ensure hibernating session is not connected

Turns out that if you destroy a session from inside prosody, it goes
into hibernation but stays connected and continues processing stanzas.

diff -r 5d8264f464a2 -r c7c0c40487e2 plugins/mod_smacks.lua
--- a/plugins/mod_smacks.lua	Wed Dec 01 23:18:18 2021 +0100
+++ b/plugins/mod_smacks.lua	Thu Dec 02 03:03:44 2021 +0100
@@ -514,6 +514,9 @@
 					session.log("debug", "Session resumed before hibernation timeout, all is well")
 				end
 			end);
+			if session.conn then
+				session.conn:close();
+			end
 			return true; -- Postpone destruction for now
 		end
 	end