# HG changeset patch # User Kim Alvefur # Date 1360464105 -3600 # Node ID f657ed8f464eb950241aca415943de0181595fd1 # Parent 843fabce2fc74b4f18aad112e32df99ee736be38 plugins.smacks: Start counting when sending diff -r 843fabce2fc7 -r f657ed8f464e plugins/smacks.lua --- a/plugins/smacks.lua Sun Feb 10 03:29:04 2013 +0100 +++ b/plugins/smacks.lua Sun Feb 10 03:41:45 2013 +0100 @@ -68,11 +68,6 @@ stream:warn("Received bad ack for "..new_ack.." when last ack was "..last_ack); end elseif stanza.name == "enabled" then - stream.smacks = true; - - -- Catch stanzas - stream:hook("stanza", incoming_stanza); - stream:hook("outgoing", outgoing_stanza); if stanza.attr.id then stream.resumption_token = stanza.attr.id; @@ -105,6 +100,11 @@ --stream:unhook("bind-success", on_bind_success); stream:debug("smacks: sending enable"); stream:send(verse.stanza("enable", { xmlns = xmlns_sm, resume = "true" })); + stream.smacks = true; + + -- Catch stanzas + stream:hook("stanza", incoming_stanza); + stream:hook("outgoing", outgoing_stanza); end end