Software / code / prosody-modules
Comparison
mod_pinger/mod_pinger.lua @ 2672:75ab061069aa
mod_pinger: Don't ping when smacks hibernated the session, fixes #712
| author | tmolitor <thilo@eightysoft.de> |
|---|---|
| date | Thu, 06 Apr 2017 02:35:06 +0200 |
| parent | 2671:80b6c63cb559 |
| child | 2674:c971b2cee2cc |
comparison
equal
deleted
inserted
replaced
| 2671:80b6c63cb559 | 2672:75ab061069aa |
|---|---|
| 46 end | 46 end |
| 47 end | 47 end |
| 48 | 48 |
| 49 module:hook("resource-bind", function (event) watch_session(event.session); end); | 49 module:hook("resource-bind", function (event) watch_session(event.session); end); |
| 50 module:hook("resource-unbind", function (event) unwatch_session(event.session); end); | 50 module:hook("resource-unbind", function (event) unwatch_session(event.session); end); |
| 51 | |
| 52 -- handle smacks sessions properly (not pinging in hibernated state) | |
| 53 module:hook("smacks-hibernation-start", function (event) unwatch_session(event.origin); end); | |
| 54 module:hook("smacks-hibernation-end", function (event) watch_session(event.origin); end); |