# HG changeset patch # User tmolitor # Date 1491600880 -7200 # Node ID c971b2cee2cc82f6c3f498350ec6f4b2b1e28f15 # Parent 2e1a4740adee6c80cc261942bb55a95288ee636a mod_pinger: Try to solve smacks related issues, see #712 diff -r 2e1a4740adee -r c971b2cee2cc mod_pinger/mod_pinger.lua --- a/mod_pinger/mod_pinger.lua Thu Apr 06 10:14:00 2017 +0200 +++ b/mod_pinger/mod_pinger.lua Fri Apr 07 23:34:40 2017 +0200 @@ -15,11 +15,13 @@ local session = watchdog.session; if not session.idle_pinged then session.idle_pinged = true; - if session.smacks and not session.awaiting_ack then + if session.smacks then + if not session.awaiting_ack then session.send(st.stanza("r", { xmlns = session.smacks })) + end else - session.send(st.iq({ type = "get", from = module.host, id = "idle-check" }) - :tag("ping", { xmlns = "urn:xmpp:ping" })); + session.send(st.iq({ type = "get", from = module.host, id = "idle-check" }) + :tag("ping", { xmlns = "urn:xmpp:ping" })); end return ping_timeout; -- Call us again after ping_timeout else @@ -51,4 +53,4 @@ -- handle smacks sessions properly (not pinging in hibernated state) module:hook("smacks-hibernation-start", function (event) unwatch_session(event.origin); end); -module:hook("smacks-hibernation-end", function (event) watch_session(event.origin); end); +module:hook("smacks-hibernation-end", function (event) watch_session(event.resumed); end);