aboutsummaryrefslogtreecommitdiffstats
path: root/net/connhandlers.lua
diff options
context:
space:
mode:
Diffstat (limited to 'net/connhandlers.lua')
-rw-r--r--net/connhandlers.lua16
1 files changed, 16 insertions, 0 deletions
diff --git a/net/connhandlers.lua b/net/connhandlers.lua
new file mode 100644
index 00000000..493f1946
--- /dev/null
+++ b/net/connhandlers.lua
@@ -0,0 +1,16 @@
+
+local lxp = require "lxp"
+local init_xmlhandlers = require "core.xmlhandlers"
+
+module "connhandlers"
+
+
+function new(name, session)
+ if name == "xmpp-client" then
+ local parser = lxp.new(init_xmlhandlers(session), ":");
+ local parse = parser.parse;
+ return { data = function (self, data) return parse(parser, data); end, parser = parser }
+ end
+end
+
+return _M; \ No newline at end of file