aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2018-11-17 15:28:49 +0100
committerKim Alvefur <zash@zash.se>2018-11-17 15:28:49 +0100
commit23be1afef652d71745c7b0aa7a9786bad95e3f3f (patch)
tree632b38a0e6d0f171b1dc376b2cbb56ac62e049a4
parent50f63355017b033f4534f6012c796c7b5241a2d5 (diff)
downloadprosody-23be1afef652d71745c7b0aa7a9786bad95e3f3f.tar.gz
prosody-23be1afef652d71745c7b0aa7a9786bad95e3f3f.zip
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>".
-rw-r--r--plugins/mod_csi_simple.lua6
1 files 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;