X-Git-Url: https://git.enpas.org/?a=blobdiff_plain;f=util%2Fjid.lua;h=b43247ccbbd0d055bbeca6ff6e5c78a8e8ab2ccf;hb=020b58d94cd173ac6e67bd17dc52d5f0c49a03a4;hp=4f8b6d4161d25e7a3819616591ab2a9db59351b6;hpb=5dd6384aa54a7245faa18b685dce6544f9cb66d7;p=prosody.git diff --git a/util/jid.lua b/util/jid.lua index 4f8b6d41..b43247cc 100644 --- a/util/jid.lua +++ b/util/jid.lua @@ -1,4 +1,4 @@ --- Prosody IM v0.4 +-- Prosody IM -- Copyright (C) 2008-2009 Matthew Wild -- Copyright (C) 2008-2009 Waqas Hussain -- @@ -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;