Changeset

326:f657ed8f464e

plugins.smacks: Start counting when sending <enable/>
author Kim Alvefur <zash@zash.se>
date Sun, 10 Feb 2013 03:41:45 +0100
parents 325:843fabce2fc7
children 327:963d156a4b36
files plugins/smacks.lua
diffstat 1 files changed, 5 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- 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