plugins/mod_csi_simple.lua
branch0.11
changeset 9654 db6bcafd76c9
parent 9653 a20849226598
child 9655 989cf872d5c0
equal deleted inserted replaced
9653:a20849226598 9654:db6bcafd76c9
    84 		function session.send(stanza)
    84 		function session.send(stanza)
    85 			if session.state == "active" or module:fire_event("csi-is-stanza-important", { stanza = stanza, session = session }) then
    85 			if session.state == "active" or module:fire_event("csi-is-stanza-important", { stanza = stanza, session = session }) then
    86 				pump:flush();
    86 				pump:flush();
    87 				send(stanza);
    87 				send(stanza);
    88 			else
    88 			else
    89 				if st.is_stanza(stanza) and st.attr.xmlns == nil and st.name ~= "iq" then
    89 				if st.is_stanza(stanza) and stanza.attr.xmlns == nil and stanza.name ~= "iq" then
    90 					stanza = st.clone(stanza);
    90 					stanza = st.clone(stanza);
    91 					stanza:add_direct_child(st.stanza("delay", {xmlns = "urn:xmpp:delay", from = bare_jid, stamp = dt.datetime()}));
    91 					stanza:add_direct_child(st.stanza("delay", {xmlns = "urn:xmpp:delay", from = bare_jid, stamp = dt.datetime()}));
    92 				end
    92 				end
    93 				pump:push(stanza);
    93 				pump:push(stanza);
    94 			end
    94 			end