From 5309dbf4a16ced97fda805103c74b208c540f2b4 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Sat, 14 Dec 2013 17:25:17 +0100 Subject: mod_muc: Remove extra parenthesis (thanks janhouse) --- plugins/muc/mod_muc.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/muc/mod_muc.lua b/plugins/muc/mod_muc.lua index c8488a85..edebf070 100644 --- a/plugins/muc/mod_muc.lua +++ b/plugins/muc/mod_muc.lua @@ -155,7 +155,7 @@ function stanza_handler(event) return true; end if not(restrict_room_creation) or - is_admin(stanza.attr.from)) or + is_admin(stanza.attr.from) or (restrict_room_creation == "local" and select(2, jid_split(stanza.attr.from)) == module.host:gsub("^[^%.]+%.", "")) then room = create_room(bare); end -- cgit v1.2.3 From 619f61c2860780d8588ad589d988535b3e2af13a Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Mon, 16 Dec 2013 02:03:35 +0000 Subject: util.jid: Strip trailing '.' when normalizing hostnames --- util/jid.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/util/jid.lua b/util/jid.lua index 4c4371d8..8e0a784c 100644 --- a/util/jid.lua +++ b/util/jid.lua @@ -8,7 +8,7 @@ -local match = string.match; +local match, sub = string.match, string.sub; local nodeprep = require "util.encodings".stringprep.nodeprep; local nameprep = require "util.encodings".stringprep.nameprep; local resourceprep = require "util.encodings".stringprep.resourceprep; @@ -47,6 +47,9 @@ end local function _prepped_split(jid) local node, host, resource = _split(jid); if host then + if sub(host, -1, -1) == "." then -- Strip empty root label + host = sub(host, 1, -2); + end host = nameprep(host); if not host then return; end if node then -- cgit v1.2.3