Diff

plugins/mod_csi_simple.lua @ 9631:d6104aaf94bc 0.11

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, "</stream>".
author Kim Alvefur <zash@zash.se>
date Sat, 17 Nov 2018 15:28:49 +0100
parent 9589:aeb054ee88c5
child 9632:fdefc43bffff
line wrap: on
line diff
--- a/plugins/mod_csi_simple.lua	Sat Nov 17 15:26:11 2018 +0100
+++ b/plugins/mod_csi_simple.lua	Sat Nov 17 15:28:49 2018 +0100
@@ -82,8 +82,10 @@
 				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;