scansion/objects/client.lua

changeset 51
afc7765827be
parent 50
0ce9c9a0c2a0
child 52
3eedbb76e3f2
--- a/scansion/objects/client.lua	Wed Oct 28 02:26:53 2015 +0100
+++ b/scansion/objects/client.lua	Tue Nov 03 17:37:15 2015 +0100
@@ -53,7 +53,7 @@
 
 	connects = function (client)
 		local wait, done = async.waiter();
-		client.stream:hook("ready", function () client.log"ready" done() client.log("ready done") end);
+		client.stream:hook("ready", function () client.log"ready" done() client.log("ready done") client.stream.conn:pause() end);
 		client.stream:connect_client(client.jid, client.password);
 		wait();
 		client.full_jid = client.stream.jid;
@@ -79,6 +79,7 @@
 			end
 			expected_stanza = nil;
 			client.stream:unhook("stanza", stanza_handler);
+			client.stream.conn:pause();
 			done();
 		end
 		client.stream:hook("stanza", stanza_handler, 100);
@@ -88,6 +89,7 @@
 			error("Timed out waiting for stanza");
 			done();
 		end);
+		client.stream.conn:resume();
 		wait();
 	end;
 

mercurial