Software /
code /
prosody-modules
Diff
mod_push2/mod_push2.lua @ 6214:fe9f2c618e8a
mod_push2: option to keep hibernating after first push
author | Stephen Paul Weber <singpolyma@singpolyma.net> |
---|---|
date | Mon, 24 Mar 2025 09:28:25 -0500 |
parent | 6213:811bd0872682 |
child | 6215:e53f0967520c |
line wrap: on
line diff
--- a/mod_push2/mod_push2.lua Mon Mar 24 08:53:36 2025 -0500 +++ b/mod_push2/mod_push2.lua Mon Mar 24 09:28:25 2025 -0500 @@ -16,6 +16,7 @@ -- configuration local contact_uri = module:get_option_string("contact_uri", "xmpp:" .. module.host) local extended_hibernation_timeout = module:get_option_number("push_max_hibernation_timeout", 72*3600) -- use same timeout like ejabberd +local hibernate_past_first_push = module:get_option_boolean("hibernate_past_first_push", true) local host_sessions = prosody.hosts[module.host].sessions local push2_registrations = module:open_store("push2_registrations", "keyval") @@ -429,7 +430,7 @@ -- if the message was important -- then record the time of first push in the session for the smack module which will extend its hibernation -- timeout based on the value of session.first_hibernated_push - if is_important(stanza, session) then + if is_important(stanza, session) and not hibernate_past_first_push then session.first_hibernated_push = os_time(); -- check for prosody 0.12 mod_smacks if session.hibernating_watchdog and session.original_smacks_callback and session.original_smacks_timeout then