# HG changeset patch # User Florian Zeitz # Date 1412032630 -7200 # Node ID 8ac4438925cf850c90efe9954536c59c2a593d53 # Parent 48d95ab404c762f29377e9db5b59983ef65ae06a mod_smacks: Examine the state of the stanza *before* it was send diff -r 48d95ab404c7 -r 8ac4438925cf mod_smacks/mod_smacks.lua --- a/mod_smacks/mod_smacks.lua Sat Sep 27 19:29:28 2014 +0200 +++ b/mod_smacks/mod_smacks.lua Tue Sep 30 01:17:10 2014 +0200 @@ -82,8 +82,8 @@ local _send = session.sends2s or session.send; local function new_send(stanza) - local attr = stanza.attr; - if attr and not attr.xmlns then -- Stanza in default stream namespace + local xmlns = stanza.attr and stanza.attr.xmlns; + if not xmlns then -- Stanza in default stream namespace local cached_stanza = st.clone(stanza); if cached_stanza and cached_stanza:get_child("delay", xmlns_delay) == nil then @@ -100,7 +100,7 @@ return true; end local ok, err = _send(stanza); - if ok and #queue > max_unacked_stanzas and not session.awaiting_ack and attr and not attr.xmlns then + if ok and #queue > max_unacked_stanzas and not session.awaiting_ack and not xmlns then session.awaiting_ack = true; return _send(st.stanza("r", sm_attr)); end