aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2021-12-20 00:18:47 +0100
committerKim Alvefur <zash@zash.se>2021-12-20 00:18:47 +0100
commitafb195c62390670c8eee3a943b9108cf9086bf74 (patch)
treefef48a0d9ad1fdc07cacf63d5842b813941ef6f1
parente813cdf91b46658774256dc522ec9887582668cf (diff)
downloadprosody-afb195c62390670c8eee3a943b9108cf9086bf74.tar.gz
prosody-afb195c62390670c8eee3a943b9108cf9086bf74.zip
mod_smacks: Only include max resumption time when resumption is activated
-rw-r--r--plugins/mod_smacks.lua4
1 files changed, 3 insertions, 1 deletions
diff --git a/plugins/mod_smacks.lua b/plugins/mod_smacks.lua
index 307d5771..fe60bce3 100644
--- a/plugins/mod_smacks.lua
+++ b/plugins/mod_smacks.lua
@@ -255,14 +255,16 @@ function handle_enable(session, stanza, xmlns_sm)
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);