Diff

main.lua @ 38:3fdfd6e0cb4e

SASL! (but before you get too excited, no resource binding yet. And yes, there are still plenty of rough edges to the code...) ((eg. must move <stream:features> out of xmlhandlers.lua o_O ))
author Matthew Wild <mwild1@gmail.com>
date Thu, 02 Oct 2008 01:08:58 +0100
parent 37:06eadafafefa
child 49:1cd2a8db392d
line wrap: on
line diff
--- a/main.lua	Thu Oct 02 00:00:35 2008 +0100
+++ b/main.lua	Thu Oct 02 01:08:58 2008 +0100
@@ -21,6 +21,7 @@
 require "core.usermanager"
 require "core.sessionmanager"
 require "core.stanza_router"
+require "net.connhandlers"
 require "util.stanza"
 require "util.jid"
  
@@ -31,7 +32,6 @@
 local m_random = math.random;
 local format = string.format;
 local st = stanza;
-local init_xmlhandlers = xmlhandlers.init_xmlhandlers;
 ------------------------------
 
 
@@ -63,8 +63,8 @@
 		print("Client connected");
 		
 		session.stanza_dispatch = function (stanza) return core_process_stanza(session, stanza); end
-		session.xml_handlers = init_xmlhandlers(session);
-		session.parser = lxp.new(session.xml_handlers, ":");
+		
+		session.connhandler = connhandlers.new("xmpp-client", session);
 			
 		function session.disconnect(err)
 			if session.last_presence and session.last_presence.attr.type ~= "unavailable" then
@@ -82,7 +82,7 @@
 		end
 	end
 	if data then
-		session.parser:parse(data);
+		session.connhandler:data(data);
 	end
 	
 	--log("info", "core", "Client disconnected, connection closed");