diff mod_srvinjection/mod_srvinjection.lua @ 1324:853a382c9bd6

mod_turncredentials: Advertise the XEP-0215 feature (thanks Gryffus)
author Kim Alvefur <zash@zash.se>
date Fri, 28 Feb 2014 15:36:06 +0100
parents 69f7840923f5
children b21236b6b8d8
line wrap: on
line diff
--- a/mod_srvinjection/mod_srvinjection.lua	Wed Feb 26 13:08:47 2014 -0800
+++ b/mod_srvinjection/mod_srvinjection.lua	Fri Feb 28 15:36:06 2014 +0100
@@ -1,3 +1,4 @@
+local s = require"util.serialization".new"oneline".serialize;
 
 module:set_global();
 
@@ -25,8 +26,12 @@
 
 local original_lookup = adns.lookup;
 function adns.lookup(handler, qname, qtype, qclass)
+	module:log("debug", "adns.lookup(%s, %s, %s)", s(qname), s(qtype), s(qclass));
 	if qtype == "SRV" then
 		local host = qname:match("^_xmpp%-server%._tcp%.(.*)%.$");
+		module:log("debug", "qname:match(...) → %s", s(host));
+		local mapping = map[host] or map["*"];
+		module:log("debug", "map[%s] → %s", s(host), s(mapping));
 		local mapping = map[host] or map["*"];
 		if mapping then
 			handler(mapping);