diff options
author | Kim Alvefur <zash@zash.se> | 2014-08-07 17:35:11 +0200 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2014-08-07 17:35:11 +0200 |
commit | d68e3b56200c4c208e38d75b3396ae8c9de27423 (patch) | |
tree | bc21748c9d3641c8a7ea59ffbea022a5b955ecca /util/jid.lua | |
parent | 8aabc3b56c2dee60cc275f51c922cda0a7e30970 (diff) | |
download | prosody-d68e3b56200c4c208e38d75b3396ae8c9de27423.tar.gz prosody-d68e3b56200c4c208e38d75b3396ae8c9de27423.zip |
util.jid: Use existing join function in jid.prep
Diffstat (limited to 'util/jid.lua')
-rw-r--r-- | util/jid.lua | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/util/jid.lua b/util/jid.lua index 5db3d1f0..14d8f2b4 100644 --- a/util/jid.lua +++ b/util/jid.lua @@ -65,21 +65,8 @@ local function _prepped_split(jid) end prepped_split = _prepped_split; -function prep(jid) - local node, host, resource = _prepped_split(jid); - if host then - if node then - host = node .. "@" .. host; - end - if resource then - host = host .. "/" .. resource; - end - end - return host; -end - -function join(node, host, resource) - if not host then return end -- Invalid JID +local function _join(node, host, resource) + if not host then return end if node and resource then return node.."@"..host.."/"..resource; elseif node then @@ -89,6 +76,12 @@ function join(node, host, resource) end return host; end +join = _join; + +function prep(jid) + local node, host, resource = _prepped_split(jid); + return _join(node, host, resource); +end function compare(jid, acl) -- compare jid to single acl rule |