aboutsummaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
Diffstat (limited to 'util')
-rw-r--r--util/jid.lua23
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