util/jid.lua

Tue, 14 Oct 2008 09:54:49 +0500

author
Waqas Hussain <waqas20@gmail.com>
date
Tue, 14 Oct 2008 09:54:49 +0500
changeset 104
cfbd3b849f9e
parent 29
b847875801e5
child 109
7efedc96352a
permissions
-rw-r--r--

Fixed: util/jid.lua now returns module object


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

return _M;

mercurial