Changeset

4458:5234d0c8883d

mod_smacks: Only act on CSI state changes if smacks is enabled Fixes attempt to get length of a nil value (local 'queue') in request_ack_if_needed()
author Kim Alvefur <zash@zash.se>
date Mon, 22 Feb 2021 16:44:40 +0100
parents 4457:091d06c7d724
children 4459:dbfda7f5522d
files mod_smacks/mod_smacks.lua
diffstat 1 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mod_smacks/mod_smacks.lua	Mon Feb 22 13:45:29 2021 +0000
+++ b/mod_smacks/mod_smacks.lua	Mon Feb 22 16:44:40 2021 +0100
@@ -642,11 +642,15 @@
 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);
+	if event.origin.smacks then
+		request_ack_if_needed(event.origin, true, "csi-active", nil);
+	end
 end);
 
 module:hook("csi-flushing", function (event)
-	request_ack_if_needed(event.session, true, "csi-active", nil);
+	if event.origin.smacks then
+		request_ack_if_needed(event.session, true, "csi-active", nil);
+	end
 end);
 
 local function handle_read_timeout(event)