Fri, 18 Mar 2011 21:39:57 +0000
verse.client: Reopen stream in response to 'connected' event
client.lua | file | annotate | diff | comparison | revisions |
--- a/client.lua Fri Mar 18 21:33:53 2011 +0000 +++ b/client.lua Fri Mar 18 21:39:57 2011 +0000 @@ -72,6 +72,7 @@ self:close("xml-not-well-formed"); end + self:hook("connected", function () self:reopen(); end); self:hook("incoming-raw", function (data) return self.data(self.conn, data); end); self.curr_id = 0; @@ -136,7 +137,6 @@ local function start_connect() -- Initialise connection self:connect(self.connect_host or self.host, self.connect_port or 5222); - self:reopen(); end if not (self.connect_host or self.connect_port) then