Comparison

client.lua @ 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
parent 38:c40cc28ac7df
child 47:3ebffb4fc48c
comparison
equal deleted inserted replaced
45:50a2e4fb0a16 46:6a329776fb42
105 105
106 function stream:close(reason) 106 function stream:close(reason)
107 if not self.notopen then 107 if not self.notopen then
108 self:send("</stream:stream>"); 108 self:send("</stream:stream>");
109 end 109 end
110 local on_disconnect = self.conn.disconnect();
110 self.conn:close(); 111 self.conn:close();
112 on_disconnect(conn, reason);
111 end 113 end
112 114
113 function stream:send_iq(iq, callback) 115 function stream:send_iq(iq, callback)
114 local id = self:new_id(); 116 local id = self:new_id();
115 self.tracked_iqs[id] = callback; 117 self.tracked_iqs[id] = callback;