aboutsummaryrefslogtreecommitdiffstats
path: root/util/jid.lua
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2016-03-18 14:03:35 +0000
committerMatthew Wild <mwild1@gmail.com>2016-03-18 14:03:35 +0000
commit8c0392226672520d8a4a59e7f2544a2d4297d739 (patch)
treecc8a353f9fd1d39993e99256dd784e813d0e4153 /util/jid.lua
parent401fde4ef607e993432c50ee2b23e6b34a5746ea (diff)
parent3b6bbde55c734ea709db7dbb3d7e293fa6440220 (diff)
downloadprosody-8c0392226672520d8a4a59e7f2544a2d4297d739.tar.gz
prosody-8c0392226672520d8a4a59e7f2544a2d4297d739.zip
Merge 0.10->trunk
Diffstat (limited to 'util/jid.lua')
-rw-r--r--util/jid.lua15
1 files changed, 15 insertions, 0 deletions
diff --git a/util/jid.lua b/util/jid.lua
index 76155ac7..60bb0829 100644
--- a/util/jid.lua
+++ b/util/jid.lua
@@ -93,6 +93,18 @@ local function compare(jid, acl)
return false
end
+local function node(jid)
+ return (select(1, split(jid)));
+end
+
+local function host(jid)
+ return (select(2, split(jid)));
+end
+
+local function resource(jid)
+ return (select(3, split(jid)));
+end
+
local function escape(s) return s and (s:gsub(".", escapes)); end
local function unescape(s) return s and (s:gsub("\\%x%x", unescapes)); end
@@ -103,6 +115,9 @@ return {
join = join;
prep = prep;
compare = compare;
+ node = node;
+ host = host;
+ resource = resource;
escape = escape;
unescape = unescape;
};