Changeset

12080:9744a0ceb767

mod_smacks: Only include max resumption time when resumption is activated
author Kim Alvefur <zash@zash.se>
date Mon, 20 Dec 2021 00:18:47 +0100
parents 12079:76a5c0261793
children 12081:6cc3135138d7
files plugins/mod_smacks.lua
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/mod_smacks.lua	Mon Dec 20 00:16:22 2021 +0100
+++ b/plugins/mod_smacks.lua	Mon Dec 20 00:18:47 2021 +0100
@@ -255,14 +255,16 @@
 
 	wrap_session(session, false);
 
+	local resume_max;
 	local resume_token;
 	local resume = stanza.attr.resume;
 	if resume == "true" or resume == "1" then
 		resume_token = uuid_generate();
 		session_registry[jid.join(session.username, session.host, resume_token)] = session;
 		session.resumption_token = resume_token;
+		resume_max = tostring(resume_timeout);
 	end
-	(session.sends2s or session.send)(st.stanza("enabled", { xmlns = xmlns_sm, id = resume_token, resume = resume, max = tostring(resume_timeout) }));
+	(session.sends2s or session.send)(st.stanza("enabled", { xmlns = xmlns_sm, id = resume_token, resume = resume, max = resume_max }));
 	return true;
 end
 module:hook_tag(xmlns_sm2, "enable", function (session, stanza) return handle_enable(session, stanza, xmlns_sm2); end, 100);