Annotate
net/connhandlers.lua @ 90:da468ed49a7b
Stanza preserialize/deserialize helpers, to strip and restore stanzas respectively. Fixed mod_vcard to use these.
author |
Matthew Wild <mwild1@gmail.com> |
date |
Thu, 09 Oct 2008 00:50:45 +0100 |
parent |
38:3fdfd6e0cb4e |
rev |
line source |
38
|
1
|
|
2 local lxp = require "lxp"
|
|
3 local init_xmlhandlers = require "core.xmlhandlers"
|
|
4
|
|
5 module "connhandlers"
|
|
6
|
|
7
|
|
8 function new(name, session)
|
|
9 if name == "xmpp-client" then
|
|
10 local parser = lxp.new(init_xmlhandlers(session), ":");
|
|
11 local parse = parser.parse;
|
|
12 return { data = function (self, data) return parse(parser, data); end, parser = parser }
|
|
13 end
|
|
14 end
|
|
15
|
|
16 return _M; |