# HG changeset patch # User Matthew Wild # Date 1286464609 -3600 # Node ID 57de4a7840ef3690b4c1438e468de23cfba89a10 # Parent 9b9b089407b1dccf783852abdcd3f0f204e0e614 mod_smacks: Fixes for storing the unacked stanzas so that they can be properly replayed to clients on stream resume diff -r 9b9b089407b1 -r 57de4a7840ef mod_smacks/mod_smacks.lua --- a/mod_smacks/mod_smacks.lua Thu Oct 07 16:14:31 2010 +0100 +++ b/mod_smacks/mod_smacks.lua Thu Oct 07 16:16:49 2010 +0100 @@ -34,7 +34,7 @@ local function new_send(stanza) local attr = stanza.attr; if attr and not attr.xmlns then -- Stanza in default stream namespace - queue[#queue+1] = st.reply(stanza); + queue[#queue+1] = st.clone(stanza); end local ok, err = _send(stanza); if ok and #queue > max_unacked_stanzas and not session.awaiting_ack then @@ -107,12 +107,12 @@ if #queue > 0 then session.outgoing_stanza_queue = {}; for i=1,#queue do - local reply = queue[i]; + local reply = st.reply(queue[i]); if reply.attr.to ~= session.full_jid then reply.attr.type = "error"; reply:tag("error", error_attr) :tag("recipient-unavailable", {xmlns = "urn:ietf:params:xml:ns:xmpp-stanzas"}); - core_process_stanza(session, queue[i]); + core_process_stanza(session, reply); end end end