Changeset

12066:f07c8240a71d

mod_smacks: Split log messages for when an old session exists in storage Non-existent did not seem entirely accurate for this case
author Kim Alvefur <zash@zash.se>
date Fri, 17 Dec 2021 16:29:17 +0100 (2021-12-17)
parents 12065:9102cbd2aec4
children 12067:97c377de8083
files plugins/mod_smacks.lua
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/mod_smacks.lua	Fri Dec 17 16:21:26 2021 +0100
+++ b/plugins/mod_smacks.lua	Fri Dec 17 16:29:17 2021 +0100
@@ -497,14 +497,15 @@
 	local id = stanza.attr.previd;
 	local original_session = session_registry[jid.join(session.username, session.host, id)];
 	if not original_session then
-		session.log("debug", "Tried to resume non-existent session with id %s", id);
 		local old_session = old_session_registry:get(session.username, id);
 		if old_session then
+			session.log("debug", "Tried to resume old expired session with id %s", id);
 			session.send(st.stanza("failed", { xmlns = xmlns_sm, h = format_h(old_session.h) })
 				:tag("item-not-found", { xmlns = xmlns_errors })
 			);
 			old_session_registry:set(session.username, id, nil);
 		else
+			session.log("debug", "Tried to resume non-existent session with id %s", id);
 			session.send(st.stanza("failed", { xmlns = xmlns_sm })
 				:tag("item-not-found", { xmlns = xmlns_errors })
 			);