Changeset

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
parents 9630:bff66c3faceb
children 9632:fdefc43bffff
files plugins/mod_csi_simple.lua
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
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;