diff options
author | Kim Alvefur <zash@zash.se> | 2021-12-20 00:18:47 +0100 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2021-12-20 00:18:47 +0100 |
commit | afb195c62390670c8eee3a943b9108cf9086bf74 (patch) | |
tree | fef48a0d9ad1fdc07cacf63d5842b813941ef6f1 | |
parent | e813cdf91b46658774256dc522ec9887582668cf (diff) | |
download | prosody-afb195c62390670c8eee3a943b9108cf9086bf74.tar.gz prosody-afb195c62390670c8eee3a943b9108cf9086bf74.zip |
mod_smacks: Only include max resumption time when resumption is activated
-rw-r--r-- | plugins/mod_smacks.lua | 4 |
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); |