# HG changeset patch # User Kim Alvefur # Date 1407425711 -7200 # Node ID 1c19464cde77f3cc1aca8bacde280f2fb4403ca6 # Parent 736c388748fd89ae84db5e3091211ce2ba8cf12b util.jid: Use existing join function in jid.prep diff -r 736c388748fd -r 1c19464cde77 util/jid.lua --- a/util/jid.lua Thu Aug 07 17:20:51 2014 +0200 +++ b/util/jid.lua Thu Aug 07 17:35:11 2014 +0200 @@ -65,21 +65,8 @@ 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 @@ 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