Diff

mod_smacks/mod_smacks.lua @ 4445:e13eb0f851c8

mod_smacks: Explicitly request ack when leaving CSI-inactive mode There may be a lot of unacked stanzas in the queue, might as well...
author Kim Alvefur <zash@zash.se>
date Tue, 16 Feb 2021 22:49:44 +0100
parent 4444:2f5e52d67928
child 4446:3d593b612e07
line wrap: on
line diff
--- a/mod_smacks/mod_smacks.lua	Tue Feb 16 21:33:39 2021 +0100
+++ b/mod_smacks/mod_smacks.lua	Tue Feb 16 22:49:44 2021 +0100
@@ -2,7 +2,7 @@
 --
 -- Copyright (C) 2010-2015 Matthew Wild
 -- Copyright (C) 2010 Waqas Hussain
--- Copyright (C) 2012-2015 Kim Alvefur
+-- Copyright (C) 2012-2021 Kim Alvefur
 -- Copyright (C) 2012 Thijs Alkemade
 -- Copyright (C) 2014 Florian Zeitz
 -- Copyright (C) 2016-2020 Thilo Molitor
@@ -641,6 +641,10 @@
 module:hook_stanza(xmlns_sm2, "resume", function (session, stanza) return handle_resume(session, stanza, xmlns_sm2); end);
 module:hook_stanza(xmlns_sm3, "resume", function (session, stanza) return handle_resume(session, stanza, xmlns_sm3); end);
 
+module:hook("csi-client-active", function (event)
+	request_ack_if_needed(event.origin, true, "csi-active", nil);
+end);
+
 local function handle_read_timeout(event)
 	local session = event.session;
 	if session.smacks then