Mercurial > prosody-modules
comparison mod_cloud_notify/mod_cloud_notify.lua @ 5052:d7ece68de066
mod_cloud_notify: Only delay hibernation timeout for push-enabled clients
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Fri, 23 Sep 2022 22:39:49 +0100 |
parents | 031e0dd90f4b |
children | 00e8cc6860cb |
comparison
equal
deleted
inserted
replaced
5051:2718652c18ca | 5052:d7ece68de066 |
---|---|
512 -- smacks hibernation is started | 512 -- smacks hibernation is started |
513 local function hibernate_session(event) | 513 local function hibernate_session(event) |
514 local session = event.origin; | 514 local session = event.origin; |
515 local queue = event.queue; | 515 local queue = event.queue; |
516 session.first_hibernated_push = nil; | 516 session.first_hibernated_push = nil; |
517 if session.hibernating_watchdog then -- check for prosody 0.12 mod_smacks | 517 if session.push_identifier and session.hibernating_watchdog then -- check for prosody 0.12 mod_smacks |
518 -- save old watchdog callback and timeout | 518 -- save old watchdog callback and timeout |
519 session.original_smacks_callback = session.hibernating_watchdog.callback; | 519 session.original_smacks_callback = session.hibernating_watchdog.callback; |
520 session.original_smacks_timeout = session.hibernating_watchdog.timeout; | 520 session.original_smacks_timeout = session.hibernating_watchdog.timeout; |
521 -- cancel old watchdog and create a new watchdog with extended timeout | 521 -- cancel old watchdog and create a new watchdog with extended timeout |
522 session.hibernating_watchdog:cancel(); | 522 session.hibernating_watchdog:cancel(); |