Changeset

46:6a329776fb42

verse.client: Fire disconnected event when the disconnect is initiated by the client too
author Matthew Wild <mwild1@gmail.com>
date Wed, 06 Jan 2010 17:43:25 +0000
parents 45:50a2e4fb0a16
children 47:3ebffb4fc48c
files client.lua
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/client.lua	Wed Jan 06 17:42:57 2010 +0000
+++ b/client.lua	Wed Jan 06 17:43:25 2010 +0000
@@ -107,7 +107,9 @@
 	if not self.notopen then
 		self:send("</stream:stream>");
 	end
+	local on_disconnect = self.conn.disconnect();
 	self.conn:close();
+	on_disconnect(conn, reason);
 end
 
 function stream:send_iq(iq, callback)