projects
/
prosody.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4106453
)
util.jid: Add join(node, host, resource) function to join the components and return...
author
Matthew Wild
<mwild1@gmail.com>
Fri, 27 Nov 2009 17:33:55 +0000
(17:33 +0000)
committer
Matthew Wild
<mwild1@gmail.com>
Fri, 27 Nov 2009 17:33:55 +0000
(17:33 +0000)
util/jid.lua
patch
|
blob
|
history
diff --git
a/util/jid.lua
b/util/jid.lua
index ccc8309c3a23a411315c6aa6bb332d5c84c1b429..b43247ccbbd0d055bbeca6ff6e5c78a8e8ab2ccf 100644
(file)
--- a/
util/jid.lua
+++ b/
util/jid.lua
@@
-65,4
+65,17
@@
function prep(jid)
return host;
end
+function join(node, host, resource)
+ if node and host and resource then
+ return node.."@"..host.."/"..resource;
+ elseif node and host then
+ return node.."@"..host;
+ elseif host and resource then
+ return host.."/"..resource;
+ elseif host then
+ return host;
+ end
+ return nil; -- Invalid JID
+end
+
return _M;