From 301cad9b1641efbd1f185abf206c4071b81b019b Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Sat, 17 Nov 2018 15:28:49 +0100 Subject: mod_csi_simple: Skip delay tags on objects other than stanzas (thanks quest) This may be triggered by sending strings, eg as done by mod_c2s for keepalives, stream errors, "". --- plugins/mod_csi_simple.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/plugins/mod_csi_simple.lua b/plugins/mod_csi_simple.lua index 1535edae..6fc88291 100644 --- a/plugins/mod_csi_simple.lua +++ b/plugins/mod_csi_simple.lua @@ -82,8 +82,10 @@ module:hook("csi-client-inactive", function (event) pump:flush(); send(stanza); else - stanza = st.clone(stanza); - stanza:add_direct_child(st.stanza("delay", {xmlns = "urn:xmpp:delay", from = bare_jid, stamp = dt.datetime()})); + if st.is_stanza(stanza) then + stanza = st.clone(stanza); + stanza:add_direct_child(st.stanza("delay", {xmlns = "urn:xmpp:delay", from = bare_jid, stamp = dt.datetime()})); + end pump:push(stanza); end return true; -- cgit v1.2.3