Changeset

1452:0ae8787e4e7d

Merged with trunk
author Waqas Hussain <waqas20@gmail.com>
date Thu, 02 Jul 2009 00:47:21 +0500
parents 1451:cc0aa9470775 (current diff) 1450:c1c7b27b983b (diff)
children 1453:64c77c6eb30e
files
diffstat 3 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/core/s2smanager.lua	Thu Jul 02 00:43:32 2009 +0500
+++ b/core/s2smanager.lua	Thu Jul 02 00:47:21 2009 +0500
@@ -253,7 +253,7 @@
 	local w = conn.write;
 	host_session.sends2s = function (t) log("debug", "sending: %s", tostring(t)); w(tostring(t)); end
 	
-	conn.write(format([[<stream:stream xmlns='jabber:server' xmlns:db='jabber:server:dialback' xmlns:stream='http://etherx.jabber.org/streams' from='%s' to='%s' version='1.0'>]], from_host, to_host));
+	conn.write(format([[<stream:stream xmlns='jabber:server' xmlns:db='jabber:server:dialback' xmlns:stream='http://etherx.jabber.org/streams' from='%s' to='%s' version='1.0' xml:lang='en'>]], from_host, to_host));
 	log("debug", "Connection attempt in progress...");
 	return true;
 end
--- a/core/sessionmanager.lua	Thu Jul 02 00:43:32 2009 +0500
+++ b/core/sessionmanager.lua	Thu Jul 02 00:47:21 2009 +0500
@@ -165,7 +165,7 @@
 	(session.log or session)("debug", "Client sent opening <stream:stream> to %s", session.host);
 	
 	send("<?xml version='1.0'?>");
-	send(format("<stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' id='%s' from='%s' version='1.0'>", session.streamid, session.host));
+	send(format("<stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' id='%s' from='%s' version='1.0' xml:lang='en'>", session.streamid, session.host));
 
 	if not hosts[session.host] then
 		-- We don't serve this host...
--- a/plugins/mod_saslauth.lua	Thu Jul 02 00:43:32 2009 +0500
+++ b/plugins/mod_saslauth.lua	Thu Jul 02 00:47:21 2009 +0500
@@ -12,6 +12,7 @@
 local sm_bind_resource = require "core.sessionmanager".bind_resource;
 local sm_make_authenticated = require "core.sessionmanager".make_authenticated;
 local base64 = require "util.encodings".base64;
+local to_unicode = require "util.encodings".idna.to_unicode;
 
 local datamanager_load = require "util.datamanager".load;
 local usermanager_validate_credentials = require "core.usermanager".validate_credentials;
@@ -65,7 +66,7 @@
 end
 
 local function password_callback(node, hostname, realm, mechanism, decoder)
-	local password = (datamanager_load(node, hostname, "accounts") or {}).password; -- FIXME handle hashed passwords
+	local password = (datamanager_load(node, to_unicode(hostname), "accounts") or {}).password; -- FIXME handle hashed passwords
 	local func = function(x) return x; end;
 	if password then
 		if mechanism == "PLAIN" then