# HG changeset patch # User Jonas Wielicki # Date 1528370852 -7200 # Node ID 626d2c781c665c98bceb4b3f7f4268da994ce5bd # Parent 5bf79bb3cf7edf43f82a0fc6a3e692e4a2f9d1f4 mod_smacks: send maximum resumption timeout to client diff -r 5bf79bb3cf7e -r 626d2c781c66 mod_smacks/mod_smacks.lua --- a/mod_smacks/mod_smacks.lua Wed Jun 06 19:20:10 2018 +0200 +++ b/mod_smacks/mod_smacks.lua Thu Jun 07 13:27:32 2018 +0200 @@ -62,7 +62,7 @@ end; }; end - + -- use per user limited cache for prosody >= 0.10 local stores = {}; return { @@ -172,7 +172,7 @@ end); end end - + -- Trigger "smacks-ack-delayed"-event if we added new (ackable) stanzas to the outgoing queue -- and there isn't already a timer for this event running. -- If we wouldn't do this, stanzas added to the queue after the first "smacks-ack-delayed"-event @@ -181,7 +181,7 @@ session.log("debug", "Calling delayed_ack_function directly (still waiting for ack)"); delayed_ack_function(session); end - + session.last_queue_count = #queue; end @@ -278,7 +278,7 @@ session_registry.set(session.username, resume_token, session); session.resumption_token = resume_token; end - (session.sends2s or session.send)(st.stanza("enabled", { xmlns = xmlns_sm, id = resume_token, resume = resume })); + (session.sends2s or session.send)(st.stanza("enabled", { xmlns = xmlns_sm, id = resume_token, resume = resume, max = resume_timeout })); return true; end module:hook_stanza(xmlns_sm2, "enable", function (session, stanza) return handle_enable(session, stanza, xmlns_sm2); end, 100);