Merge 0.11->trunk
authorKim Alvefur <zash@zash.se>
Tue, 27 Nov 2018 21:18:19 +0100
changeset 9656 a58b48268ecd
parent 9651 0f43b901c854 (current diff)
parent 9655 989cf872d5c0 (diff)
child 9658 ede4e15a0fed
Merge 0.11->trunk
--- a/plugins/mod_csi.lua	Tue Nov 27 17:01:47 2018 +0100
+++ b/plugins/mod_csi.lua	Tue Nov 27 21:18:19 2018 +0100
@@ -11,6 +11,7 @@
 function refire_event(name)
 	return function (event)
 		if event.origin.username then
+			session.state = event.stanza.name;
 			module:fire_event(name, event);
 			return true;
 		end
--- a/plugins/mod_csi_simple.lua	Tue Nov 27 17:01:47 2018 +0100
+++ b/plugins/mod_csi_simple.lua	Tue Nov 27 21:18:19 2018 +0100
@@ -81,11 +81,11 @@
 		pump:pause();
 		session.pump = pump;
 		function session.send(stanza)
-			if module:fire_event("csi-is-stanza-important", { stanza = stanza, session = session }) then
+			if session.state == "active" or module:fire_event("csi-is-stanza-important", { stanza = stanza, session = session }) then
 				pump:flush();
 				send(stanza);
 			else
-				if st.is_stanza(stanza) then
+				if st.is_stanza(stanza) and stanza.attr.xmlns == nil and stanza.name ~= "iq" then
 					stanza = st.clone(stanza);
 					stanza:add_direct_child(st.stanza("delay", {xmlns = "urn:xmpp:delay", from = bare_jid, stamp = dt.datetime()}));
 				end