Annotate

net/connhandlers.lua @ 81:a1f4f3c5ae25

Merge roster fixes from waqas
author Matthew Wild <mwild1@gmail.com>
date Wed, 08 Oct 2008 17:27:20 +0100
parent 38:3fdfd6e0cb4e
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
38
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
1
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
2 local lxp = require "lxp"
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
3 local init_xmlhandlers = require "core.xmlhandlers"
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
4
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
5 module "connhandlers"
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
6
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
7
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
8 function new(name, session)
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
9 if name == "xmpp-client" then
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
10 local parser = lxp.new(init_xmlhandlers(session), ":");
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
11 local parse = parser.parse;
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
12 return { data = function (self, data) return parse(parser, data); end, parser = parser }
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
13 end
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
14 end
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
15
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
16 return _M;