diff options
author | Kim Alvefur <zash@zash.se> | 2016-03-18 11:55:40 +0100 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2016-03-18 11:55:40 +0100 |
commit | 5092b5f5d2b4a0ae0d8812fa09817b314e995969 (patch) | |
tree | 6946e0e43dd34b23c09d076f1a417705b15d71cc /util | |
parent | 94c745e8e83bcabc945e93ebffb5f5eead5544bf (diff) | |
parent | 42f15c4eb2f1b52b886f70eefe9c89697e825529 (diff) | |
download | prosody-5092b5f5d2b4a0ae0d8812fa09817b314e995969.tar.gz prosody-5092b5f5d2b4a0ae0d8812fa09817b314e995969.zip |
Merge
Diffstat (limited to 'util')
-rw-r--r-- | util/jid.lua | 15 |
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; }; |