Changeset

2466:0e44b6035210

net.xmpp{client,server,component}: Update for new xmlhandlers syntax
author Matthew Wild <mwild1@gmail.com>
date Tue, 19 Jan 2010 03:56:44 +0000
parents 2465:48a209636a42
children 2467:8098310d0dfd
files net/xmppclient_listener.lua net/xmppcomponent_listener.lua net/xmppserver_listener.lua
diffstat 3 files changed, 6 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/net/xmppclient_listener.lua	Tue Jan 19 03:55:19 2010 +0000
+++ b/net/xmppclient_listener.lua	Tue Jan 19 03:56:44 2010 +0000
@@ -30,8 +30,7 @@
 local config = require "core.configmanager";
 local opt_keepalives = config.get("*", "core", "tcp_keepalives");
 
-local stream_callbacks = { stream_tag = "http://etherx.jabber.org/streams\1stream", 
-		default_ns = "jabber:client",
+local stream_callbacks = { default_ns = "jabber:client",
 		streamopened = sm_streamopened, streamclosed = sm_streamclosed, handlestanza = core_process_stanza };
 
 function stream_callbacks.error(session, error, data)
@@ -71,9 +70,8 @@
 		return true;
 end
 
-
 local stream_xmlns_attr = {xmlns='urn:ietf:params:xml:ns:xmpp-streams'};
-local default_stream_attr = { ["xmlns:stream"] = stream_callbacks.stream_tag:match("[^\1]*"), xmlns = stream_callbacks.default_ns, version = "1.0", id = "" };
+local default_stream_attr = { ["xmlns:stream"] = "http://etherx.jabber.org/streams", xmlns = stream_callbacks.default_ns, version = "1.0", id = "" };
 local function session_close(session, reason)
 	local log = session.log or log;
 	if session.conn then
--- a/net/xmppcomponent_listener.lua	Tue Jan 19 03:55:19 2010 +0000
+++ b/net/xmppcomponent_listener.lua	Tue Jan 19 03:56:44 2010 +0000
@@ -32,7 +32,7 @@
 
 --- Callbacks/data for xmlhandlers to handle streams for us ---
 
-local stream_callbacks = { stream_tag = "http://etherx.jabber.org/streams\1stream", default_ns = xmlns_component };
+local stream_callbacks = { default_ns = xmlns_component };
 
 function stream_callbacks.error(session, error, data, data2)
 	log("warn", "Error processing component stream: "..tostring(error));
@@ -87,7 +87,7 @@
 
 --- Closing a component connection
 local stream_xmlns_attr = {xmlns='urn:ietf:params:xml:ns:xmpp-streams'};
-local default_stream_attr = { ["xmlns:stream"] = stream_callbacks.stream_tag:match("[^\1]*"), xmlns = stream_callbacks.default_ns, version = "1.0", id = "" };
+local default_stream_attr = { ["xmlns:stream"] = "http://etherx.jabber.org/streams", xmlns = stream_callbacks.default_ns, version = "1.0", id = "" };
 local function session_close(session, reason)
 	local log = session.log or log;
 	if session.conn then
--- a/net/xmppserver_listener.lua	Tue Jan 19 03:55:19 2010 +0000
+++ b/net/xmppserver_listener.lua	Tue Jan 19 03:56:44 2010 +0000
@@ -17,8 +17,7 @@
 local s2s_streamclosed = require "core.s2smanager".streamclosed;
 local s2s_destroy_session = require "core.s2smanager".destroy_session;
 local s2s_attempt_connect = require "core.s2smanager".attempt_connection;
-local stream_callbacks = { stream_tag = "http://etherx.jabber.org/streams\1stream", 
-		default_ns = "jabber:server",
+local stream_callbacks = { default_ns = "jabber:server",
 		streamopened = s2s_streamopened, streamclosed = s2s_streamclosed, handlestanza =  core_process_stanza };
 
 function stream_callbacks.error(session, error, data)
@@ -70,7 +69,7 @@
 end
 
 local stream_xmlns_attr = {xmlns='urn:ietf:params:xml:ns:xmpp-streams'};
-local default_stream_attr = { ["xmlns:stream"] = stream_callbacks.stream_tag:match("[^\1]*"), xmlns = stream_callbacks.default_ns, version = "1.0", id = "" };
+local default_stream_attr = { ["xmlns:stream"] = "http://etherx.jabber.org/streams", xmlns = stream_callbacks.default_ns, version = "1.0", id = "" };
 local function session_close(session, reason)
 	local log = session.log or log;
 	if session.conn then