# HG changeset patch # User Matthew Wild # Date 1387159483 0 # Node ID 04f2138dfa87b580fe24516be8cef721cc7f9f30 # Parent 783107f85ea085f25cb0ab563fbad92335bb9f12# Parent 51ead0aa3a0258f8587e3f920f10692138403b92 Merge 0.10->trunk diff -r 783107f85ea0 -r 04f2138dfa87 plugins/muc/mod_muc.lua --- a/plugins/muc/mod_muc.lua Fri Dec 13 12:53:14 2013 +0000 +++ b/plugins/muc/mod_muc.lua Mon Dec 16 02:04:43 2013 +0000 @@ -164,7 +164,7 @@ 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 diff -r 783107f85ea0 -r 04f2138dfa87 util/jid.lua --- a/util/jid.lua Fri Dec 13 12:53:14 2013 +0000 +++ b/util/jid.lua Mon Dec 16 02:04:43 2013 +0000 @@ -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 @@ 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