aboutsummaryrefslogtreecommitdiffstats
path: root/util/jid.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2014-08-07 17:35:11 +0200
committerKim Alvefur <zash@zash.se>2014-08-07 17:35:11 +0200
commit2fc4e2dd51d4e234e5b05c20b7b27bd8d13a0700 (patch)
treebc21748c9d3641c8a7ea59ffbea022a5b955ecca /util/jid.lua
parent16dbe1e35096f1cc4f25d8c161a58ee394e2bdac (diff)
downloadprosody-2fc4e2dd51d4e234e5b05c20b7b27bd8d13a0700.tar.gz
prosody-2fc4e2dd51d4e234e5b05c20b7b27bd8d13a0700.zip
util.jid: Use existing join function in jid.prep
Diffstat (limited to 'util/jid.lua')
-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