prosody/util/jid.lua
2008-09-27 19:17:40 +01:00

11 lines
260 B
Lua

local match = string.match;
module "jid"
function split(jid)
local node = match(jid, "^([^@]+)@");
local server = (node and match(jid, ".-@([^@/]+)")) or match(jid, "^([^@/]+)");
local resource = match(jid, "/(.+)$");
return node, server, resource;
end