X-Git-Url: https://git.enpas.org/?a=blobdiff_plain;f=util%2Fjid.lua;h=b43247ccbbd0d055bbeca6ff6e5c78a8e8ab2ccf;hb=a306cdfbbe5e4231ee918b21248930048ae4fcb1;hp=ccc8309c3a23a411315c6aa6bb332d5c84c1b429;hpb=ba596f33614438d0f42713ca39423bdc88eb224d;p=prosody.git diff --git a/util/jid.lua b/util/jid.lua index ccc8309c..b43247cc 100644 --- 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;