util/jid.lua

Wed, 08 Oct 2008 19:17:14 +0300

author
Paul-Sebastian Manole <brokenthorn@gmail.com>
date
Wed, 08 Oct 2008 19:17:14 +0300
changeset 75
338e75cba18d
parent 29
b847875801e5
child 104
cfbd3b849f9e
permissions
-rw-r--r--

Added script to pull from master mercurial repository
Added a few name suggestions to doc/names.txt
Minor edits.


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