Mon, 03 Jan 2011 16:46:45 +0000
util.xmppstream: Prepare for using xmllex
-- Prosody IM -- Copyright (C) 2008-2010 Matthew Wild -- Copyright (C) 2008-2010 Waqas Hussain -- -- This project is MIT/X11 licensed. Please see the -- COPYING file in the source package for more information. -- local lxp = require "lxp"; local lex = require "util.xmllex"; local st = require "util.stanza"; local stanza_mt = st.stanza_mt; local tostring = tostring; local t_insert = table.insert; local t_concat = table.concat; local t_remove = table.remove; local setmetatable = setmetatable; local default_log = require "util.logger".init("xmppstream"); local error = error; module "xmppstream" local xmlns_streams = "http://etherx.jabber.org/streams"; function new(session, stream_callbacks) local partial; local function feed(stream, data) index(data, end return { reset = function () parser = new_parser(handlers, ns_separator); parse = parser.parse; meta.reset(); end, feed = function (self, data) return parse(parser, data); end, set_session = meta.set_session; }; end return _M;