Commit graph

104 commits

Author SHA1 Message Date
Kim Alvefur
faff262ac8 mod_smacks: Refactor ack requesting to avoid some timer roundtrips
The function was too large to comprehend! Breaking it up helps
readability and reuse.

The timer round rip is only to avoid ordering weirdness when sending
from inside a stanza filter. No need when handling <r> and <a>

CSI interactions both boiled down to sending an <r> immediately.
2021-11-24 21:27:49 +01:00
Kim Alvefur
d4398ef21d mod_smacks: Fix timer lifetimes to follow session instead of module
module:add_timer() creates a timer that stops working after the module
is reloaded or unloaded, in order to prevent leaks. However, when the
timers control vital session behavior, breakage occurs after reload.
E.g. sessions would stop requesting acks and stop responding to acks.
2021-11-24 21:27:45 +01:00
Kim Alvefur
ea20acace0 mod_smacks: Clean up compat code etc
Unstoppable stoppable timer compat not needed since 26f54b462601 ca 0.11.0

module:hook_stanza was renamed in 2012

No idea what was going on with the indentation and such
2021-11-24 21:27:49 +01:00
Kim Alvefur
5e86776f0c mod_smacks: Import from prosody-modules @ eb63890ae8fc 2021-11-16 21:15:22 +01:00