diff -r 3a422606a040 -r ce349990bd21 client.lua --- a/client.lua Sat Nov 28 22:28:03 2009 +0000 +++ b/client.lua Sat Nov 28 22:29:09 2009 +0000 @@ -52,11 +52,16 @@ self.jid, self.password = jid, pass; self.username, self.host, self.resource = jid_split(jid); - reset_stream(self); self:hook("incoming-raw", function (data) return self.data(self.conn, data); end); -- Initialise connection self:connect(self.connect_host or self.host, self.connect_port or 5222); - self:send(st.stanza("stream:stream", { to = self.host, ["xmlns:stream"]='http://etherx.jabber.org/streams' }):top_tag()); + --reset_stream(self); + self:reopen(); end +function stream:reopen() + reset_stream(self); + self:send(st.stanza("stream:stream", { to = self.host, ["xmlns:stream"]='http://etherx.jabber.org/streams', xmlns = "jabber:client" }):top_tag()); +end +