plugins/smacks.lua

changeset 326
f657ed8f464e
parent 324
dbb3362c1ff3
child 350
04049524fcd1
--- 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
 

mercurial