diff options
author | Matthew Wild <mwild1@gmail.com> | 2013-12-16 02:04:43 +0000 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2013-12-16 02:04:43 +0000 |
commit | ad5bf650c75aa69e8f8168b3603ec0a787d9a26f (patch) | |
tree | 0342a9d6cca7783cc788e35fcdb464b904cde942 | |
parent | 02bc1d47f4a2a72a45f1a13dbb47813f274cb2d7 (diff) | |
parent | 975be94ee27690746706dfc360730ae0fbb8f754 (diff) | |
download | prosody-ad5bf650c75aa69e8f8168b3603ec0a787d9a26f.tar.gz prosody-ad5bf650c75aa69e8f8168b3603ec0a787d9a26f.zip |
Merge 0.10->trunk
-rw-r--r-- | plugins/muc/mod_muc.lua | 2 | ||||
-rw-r--r-- | util/jid.lua | 5 |
2 files changed, 5 insertions, 2 deletions
diff --git a/plugins/muc/mod_muc.lua b/plugins/muc/mod_muc.lua index 38c97d61..042d3891 100644 --- a/plugins/muc/mod_muc.lua +++ b/plugins/muc/mod_muc.lua @@ -164,7 +164,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 diff --git a/util/jid.lua b/util/jid.lua index 0d9a864f..08e63335 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 |