# HG changeset patch # User Matthew Wild # Date 1282397830 -3600 # Node ID ad6006779416489ea43fd544c946209dd28ce5d2 # Parent f0aec10023aa7ffe7126e3d0730a3c5379b712f5 verse.client: Update stream:close() to use base stream:close(), and not add an XMPP-specific :close() to the base stream diff -r f0aec10023aa -r ad6006779416 client.lua --- a/client.lua Sat Aug 21 14:36:21 2010 +0100 +++ b/client.lua Sat Aug 21 14:37:10 2010 +0100 @@ -108,6 +108,14 @@ self:hook("session-success", stream_ready, -1) self:hook("bind-success", stream_ready, -1); + local _base_close = self.close; + function self:close(reason) + if not self.notopen then + self:send(""); + end + return _base_close(self); + end + -- Initialise connection self:connect(self.connect_host or self.host, self.connect_port or 5222); self:reopen(); @@ -119,15 +127,6 @@ xmlns = "jabber:client", version = "1.0" }):top_tag()); end -function stream:close(reason) - if not self.notopen then - self:send(""); - end - local on_disconnect = self.conn.disconnect(); - self.conn:close(); - on_disconnect(conn, reason); -end - function stream:send_iq(iq, callback) local id = self:new_id(); self.tracked_iqs[id] = callback;