Software /
code /
prosody-modules
Comparison
mod_smacks/mod_smacks.lua @ 3110:06e07b483805
mod_smacks: Convert max number into a string before inserting it into a stanza.
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> |
---|---|
date | Fri, 08 Jun 2018 17:56:54 +0200 |
parent | 3107:f703cc6e72df |
child | 3150:14b6ad2b773f |
comparison
equal
deleted
inserted
replaced
3109:75930e4c2478 | 3110:06e07b483805 |
---|---|
277 if resume == "true" or resume == "1" then | 277 if resume == "true" or resume == "1" then |
278 resume_token = uuid_generate(); | 278 resume_token = uuid_generate(); |
279 session_registry.set(session.username, resume_token, session); | 279 session_registry.set(session.username, resume_token, session); |
280 session.resumption_token = resume_token; | 280 session.resumption_token = resume_token; |
281 end | 281 end |
282 (session.sends2s or session.send)(st.stanza("enabled", { xmlns = xmlns_sm, id = resume_token, resume = resume, max = resume_timeout })); | 282 (session.sends2s or session.send)(st.stanza("enabled", { xmlns = xmlns_sm, id = resume_token, resume = resume, max = tostring(resume_timeout) })); |
283 return true; | 283 return true; |
284 end | 284 end |
285 module:hook_stanza(xmlns_sm2, "enable", function (session, stanza) return handle_enable(session, stanza, xmlns_sm2); end, 100); | 285 module:hook_stanza(xmlns_sm2, "enable", function (session, stanza) return handle_enable(session, stanza, xmlns_sm2); end, 100); |
286 module:hook_stanza(xmlns_sm3, "enable", function (session, stanza) return handle_enable(session, stanza, xmlns_sm3); end, 100); | 286 module:hook_stanza(xmlns_sm3, "enable", function (session, stanza) return handle_enable(session, stanza, xmlns_sm3); end, 100); |
287 | 287 |