Software /
code /
verse
Diff
client.lua @ 11:ce349990bd21
verse.client: Add stream:reopen()
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Sat, 28 Nov 2009 22:29:09 +0000 |
parent | 10:3a422606a040 |
child | 12:73f466054ead |
line wrap: on
line diff
--- 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 +