From fa4bdf2950a4562958ddd9b8b3e25b6d4a1b8256 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 54824c98f10d8da89b2b2af3ab3c536e906d866d 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