util/jid.lua

Tue, 07 Oct 2008 23:13:30 +0100

author
Matthew Wild <mwild1@gmail.com>
date
Tue, 07 Oct 2008 23:13:30 +0100
changeset 69
5b664c8fef86
parent 29
b847875801e5
child 104
cfbd3b849f9e
permissions
-rw-r--r--

forgot to commit mod_tls, oops :)


local match = string.match;

module "jid"

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

mercurial