verse.client: Fire 'ready' event on stream when resource binding or session negotiation is complete, hook this instead of binding-success

Sun, 30 May 2010 02:49:02 +0100

author
Matthew Wild <mwild1@gmail.com>
date
Sun, 30 May 2010 02:49:02 +0100
changeset 76
927167321283
parent 75
f5ac4e39e84f
child 77
7af3e57501c2

verse.client: Fire 'ready' event on stream when resource binding or session negotiation is complete, hook this instead of binding-success

client.lua file | annotate | diff | comparison | revisions
--- a/client.lua	Sun May 30 02:47:19 2010 +0100
+++ b/client.lua	Sun May 30 02:49:02 2010 +0100
@@ -97,6 +97,12 @@
 		return ret;
 	end, -1);
 
+	local function stream_ready()
+		self:event("ready");
+	end
+	self:hook("session-success", stream_ready, -1)
+	self:hook("binding-success", stream_ready, -1);
+
 	-- Initialise connection
 	self:connect(self.connect_host or self.host, self.connect_port or 5222);
 	self:reopen();

mercurial