Software /
code /
prosody
Diff
util/xmppstream.lua @ 3424:9e0df614e5d0
util.xmppstream: Add set_session() method to change the session that a stream is associated with
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Mon, 02 Aug 2010 10:21:26 +0100 |
parent | 3032:38459cffaf67 |
child | 3444:e6a78e15fed2 |
line wrap: on
line diff
--- a/util/xmppstream.lua Mon Aug 02 10:20:14 2010 +0100 +++ b/util/xmppstream.lua Mon Aug 02 10:21:26 2010 +0100 @@ -145,7 +145,12 @@ stanza, chardata = nil, {}; end - return xml_handlers, { reset = reset }; + local function set_session(stream, new_session) + session = new_session; + log = new_session.log or default_log; + end + + return xml_handlers, { reset = reset, set_session = set_session }; end function new(session, stream_callbacks) @@ -161,7 +166,8 @@ end, feed = function (self, data) return parse(parser, data); - end + end, + set_session = meta.set_session; }; end